Diagnostics about advice: overriding and introducing members, implementing interfaces, adding initializers, and conflicts between aspects.
| Article | Description |
|---|---|
| LAMA0500: The introduced member already exists | An aspect introduces a member that already exists, and the override strategy doesn't allow it. |
| LAMA0502: The introduced member can't override the base member | An aspect tries to override a base member that is static, non-virtual or sealed. |
| LAMA0503: The introduced member has a different type than the existing member | An introduced member conflicts with an existing member that has a different type or return type. |
| LAMA0504: The introduced member and the existing member differ in staticity | An introduced member conflicts with an existing member, and only one of them is static. |
| LAMA0505: An aspect can't introduce an instance member into a static class | An aspect introduces an instance member into a static class. |
| LAMA0506: The introduced member conflicts with a member of a different kind | An introduced member has the same name as an existing member of a different kind. |
| LAMA0507: An introduced member can't be both static and virtual | An aspect introduces a member that is both static and virtual into a class or a struct. |
| LAMA0508: An introduced member can't be both static and sealed | An aspect introduces a member that is both static and sealed. |
| LAMA0509: OverrideStrategy.New can't hide a member declared in the same type | An aspect introduces a member with OverrideStrategy.New, but the target type already declares this member. |
| LAMA0511: The [InterfaceMember] template doesn't have the type of the interface member | An aspect member marked with [InterfaceMember] doesn't have the same type as the interface member it implements. |
| LAMA0512: The type already implements the interface | An aspect implements an interface that the target type already implements, and the strategy is to fail. |
| LAMA0513: The type arguments of the generic interface aren't specified | An aspect implements a generic interface without specifying its type arguments. |
| LAMA0514: The target type already contains a member of the interface | The target type already contains a member with the same signature as an interface member that the aspect implements implicitly. |
| LAMA0516: The override strategy isn't supported for interfaces | The override strategy passed to ImplementInterface isn't supported for interfaces. |
| LAMA0517: The template of an interface property is missing an accessor | The template of an interface property doesn't have an accessor required by the interface. |
| LAMA0518: The template of an explicit interface property has an extra accessor | The template of an explicitly implemented interface property has an accessor that the interface property doesn't have. |
| LAMA0519: An implicit interface implementation must be public | An implicit interface implementation uses an aspect member that isn't public. |
| LAMA0520: A parameter can't be introduced into a static constructor | An aspect tries to introduce a parameter into a static constructor. |
| LAMA0521: The custom attribute is already present on the declaration | An aspect introduces a custom attribute that's already present on the declaration. |
| LAMA0522: A finalizer can't be introduced with the New strategy | An aspect introduces a finalizer with an unsupported override strategy. |
| LAMA0524: An initializer can't be added to all constructors of a record | An aspect can't add an initializer to the copy constructor of a record. |
| LAMA0526: An introduced indexer must have at least one parameter | An aspect introduces an indexer that has no parameter. |
| LAMA0527: An introduced indexer can't be static | An aspect introduces a static indexer, which C# doesn't support. |
| LAMA0528: An existing member must be public to implement an interface member | An aspect implementing an interface can't override an existing member of the target type because the member isn't public. |
| LAMA0529: An inherited member must be virtual to implement an interface member | An aspect implementing an interface can't override an inherited member because the member isn't virtual or is sealed. |
| LAMA0530: A constructor parameter with the same name was already introduced | An aspect introduces a constructor parameter with the name of a parameter that an aspect already introduced. |
| LAMA0531: A type with the same name already exists | An aspect introduces a type whose name is already used by a type of the target namespace or type. |
| LAMA0532: An abstract member can't be introduced into a non-abstract type | An aspect introduces an abstract member into a type that isn't abstract. |
| LAMA0533: An abstract member can't be introduced with the Override or New strategy | An aspect introduces an abstract member with the override strategy Override or New. |
| LAMA0534: A field can't be introduced into an interface | An aspect tries to introduce a field into an interface. |
| LAMA0535: A partial member can't be introduced into a non-partial type | An aspect introduces a partial member into a type that isn't partial. |
| LAMA0536: The pull strategy must provide a value for the forwarding constructor | The pull strategy gives no value for a forwarding constructor to pass to the introduced parameter. |
| LAMA0540: Extension blocks can only be introduced into static classes | An aspect introduces an extension block into a type that isn't a static class. |
| LAMA0541: An extension block can't be introduced into another extension block | An aspect introduces an extension block into another extension block. |
| LAMA0542: An extension block can't contain an indexer with an init accessor | An aspect introduces an indexer with an init accessor into an extension block. |
| LAMA0543: An extension block can't contain a member with this modifier | An aspect introduces an indexer with a forbidden modifier into an extension block. |
| LAMA0550: The Initialize method of a non-sealed class must be public and virtual | An aspect adds an initializer to the Initialize method of a non-sealed class, but this method isn't public and virtual. |
| LAMA0551: The base type's OnConstructed method requires a constructor accepting InitializationContext | A base type defines an OnConstructed method, but none of its constructors accepts an InitializationContext. |
| LAMA0552: A compiler-synthesized record member can't be overridden | An aspect overrides a record member that the compiler always generates and that can't be declared. |
| LAMA0554: A union must declare at least one case | An aspect introduces a union without any case. |
| LAMA0555: A union can't hold an instance field, an automatic property or a field-like event | An aspect introduces an instance field, an automatic property or a field-like event into a union. |
| LAMA0556: A custom attribute can't be added to a compiler-synthesized member | An aspect introduces a custom attribute on a member that the compiler synthesizes. |
| LAMA0650: The base implementation can't be invoked on another instance | A template invokes the base implementation of a member on an instance other than this. |
| LAMA0652: A synthesized record member reads an overridable property | The original implementation of a synthesized record member reads an overridable automatic property instead of its backing field. |
| LAMA0653: A synthesized record member reads a replaced property | The original implementation of a synthesized record member reads a property that an aspect replaced without calling the original implementation. |
| LAMA0654: An overridden record member reads a property that the compiler reads through its backing field | The overridden Equals or GetHashCode of a record reads a property whose getter has a body, whereas the compiler reads its backing field. |
| LAMA0655: An overridden record member reads the backing field of a replaced event | The overridden Equals or GetHashCode of a record reads the backing field of an event that an aspect replaced without calling the original implementation. |
| LAMA0660: A redirected call was not rewritten | A call that an interceptor must redirect is in a position that the linker doesn't rewrite, so it isn't redirected. |
| LAMA0661: A variable was renamed because it hides a parameter | A variable that hides a parameter passed by a redirected call is renamed in the compiled code. |
| LAMA0699: The implementation of a constructor or indexer can't be inlined | The implementation of an overridden constructor or indexer can't be inlined. |
| LAMA0700: Declarative introductions need a type or a type member as target | An aspect with [Introduce] members is applied to a declaration that isn't a type or a type member. |
| LAMA0750: Members can't be introduced into this kind of type | An aspect with [Introduce] members is applied to an enum, a delegate, or another type that can't receive members. |
| LAMA0751: An interface marked with [InternalImplement] is implemented outside its project | An interface marked with [InternalImplement] is implemented outside its project (not reported by current versions). |