JetBrains Rider 2026.1 Help

Code inspection: Required base type conflicting another type

This inspection reports a class that uses multiple [BaseTypeRequired] attributes that reference base types that conflict with each other. This happens when one attribute requires inheriting from one concrete type, while another attribute requires a different incompatible concrete type. Since a class can only have one base class, the requirements cannot be satisfied together.

The fix is to remove the conflicting attribute usage or redesign the required base types so the decorated class can satisfy them.

using System; using JetBrains.Annotations; public class Bar { } public class Foo : Bar { } public class Foo2 : Bar { } [BaseTypeRequired(typeof(Bar))] [BaseTypeRequired(typeof(Foo))] public class MyComponentAttribute : Attribute { } [BaseTypeRequired(typeof(Foo2))] public class MyComponent2Attribute : Attribute { } [MyComponent] [MyComponent2] public class MyComponentImpl { }
using System; using JetBrains.Annotations; public class Bar { } public class Foo : Bar { } public class Foo2 : Bar { } [BaseTypeRequired(typeof(Bar))] [BaseTypeRequired(typeof(Foo))] public class MyComponentAttribute : Attribute { } [BaseTypeRequired(typeof(Foo2))] public class MyComponent2Attribute : Attribute { } [MyComponent] public class MyComponentImpl : Foo { }
30 March 2026