| Severity | Error |
| Reported by | Metalama.Framework |
| Message | The declaring type '<DeclaringType>' of the declaration '<Declaration>', which was introduced by an aspect, cannot be resolved in the compilation '<Compilation>'. This is an internal error in Metalama. Please report this issue at https://www.postsharp.net/support. |
Cause
When an aspect introduces a member into a type, Metalama keeps a reference to the type that declares this member. Metalama reports LAMA0088 when it reads the introduced member in a compilation that doesn't contain this declaring type. This happens while Metalama looks for the declarations that inherit an aspect, when the target of an inheritable aspect is a member introduced by another aspect.
The introduced member and the compilation in which it's read should always be consistent, so this situation is an internal inconsistency in Metalama, not a problem in your code. Metalama doesn't crash: it considers that the member has no derived declarations in this compilation and continues, but aspects that should be inherited from this member may be missing, so the diagnostic is an error.
In the message, <DeclaringType> is the declaring type, <Declaration> is the introduced member, and <Compilation> is the identity of the compilation in which it's read.
This diagnostic is caused by a defect in Metalama, so it can't be shown in an example.
Resolution
- Update the Metalama packages to the latest version of your release line, because the problem may be a fixed defect.
- If the error appears only in the IDE, restart the IDE or run
metalama kill. This sometimes resolves problems caused by a stale design-time cache. - If the problem persists, report it as described in How to file an issue. Include the message of the diagnostic and, if possible, the aspects involved: the aspect that introduces the member and the inheritable aspect applied to it.