| Severity | Error |
| Reported by | Metalama.Framework |
| Message | Metalama cannot read the transitive aspect manifest of the reference '<Reference>', therefore no aspect is inherited from that reference. The rest of the project is analyzed normally. The reason is: <Reason> Rebuild the referenced project or restore its package again. If the problem persists, report it at https://www.postsharp.net/support. |
Cause
When a project contains inheritable aspects, or other compile-time contributors that apply to referencing projects, Metalama embeds a transitive aspect manifest in the compiled assembly. When another project references this assembly, Metalama reads the manifest to apply the inherited aspects to the derived types and members of the referencing project.
Metalama reports LAMA0087 when reading this manifest fails. Known causes are a manifest whose bytes are damaged, for instance by a tool that rewrote the referenced assembly or an incomplete build, and a defect in Metalama that prevents the manifest from being bound to the compile-time assemblies of the referencing project. In the message, <Reference> is the path or the name of the referenced assembly, and <Reason> is the message of the exception that occurred.
Metalama skips the reference instead of stopping, so the rest of the project, including its own aspects, is processed normally. However, no aspect is inherited from this reference, which changes the generated code. That's why the diagnostic is an error: the build must fail rather than produce code that misses aspects.
This diagnostic depends on a damaged referenced assembly or on a defect in Metalama, so it can't be shown in an example.
Resolution
- Rebuild the referenced project, after cleaning its output directories, so that its assembly and its manifest are produced again. If the reference is a NuGet package, clear the package from the NuGet cache and restore it again.
- Make sure that no tool rewrites the referenced assembly after Metalama has compiled it.
- Update the Metalama packages to the latest version of your release line, because the problem may be a fixed defect.
- If the problem persists, enable logging as described in Enabling logging. Metalama logs the identity of the assembly that produced the manifest, the size of the manifest, and its first bytes, which help identify the cause. Report the problem with this log, as described in How to file an issue.