| Severity | Information |
| Reported by | PostSharp |
| Message | PostSharp needs to generate <Artifact> for the <Context> platform "<Platform>". This could take a few seconds. The result will be cached and the next build will be faster. |
Cause
To resolve the types that the assemblies of a project use, PostSharp needs data about the framework that the project targets and about the framework that PostSharp runs on. It computes this data once and stores it in its cache directory, which the PostSharpCacheDirectory MSBuild property sets, by default %LOCALAPPDATA%\PostSharp on Windows.
PostSharp reports PS0220, as an important information, just before it computes a piece of this data that the cache does not contain yet:
<Artifact>isthe type index, an index from the names of the types to the assemblies of the framework that define them, ora facade assembly for <Assembly>, an assembly that PostSharp generates to load a reference assembly at build time.<Context>isreferencefor the framework that the project targets, orruntimefor the framework that PostSharp runs on.<Platform>is the framework.
The message does not indicate a problem. It appears on the first build after the installation of PostSharp or of a new framework, or after the cache directory was deleted.
This message depends on the content of the cache of the machine, so no example can show it.
Resolution
No action is needed. The next builds on the machine find the data in the cache and do not report the message.
When every build reports the message, the cache is not kept between builds. This happens on build agents that start from a clean machine or container at each build. To make these builds faster, set the PostSharpCacheDirectory MSBuild property or environment variable to a directory that the build agent keeps, or caches, between builds. See Well-Known MSBuild Properties and Using PostSharp on a Build Server.
See Also
Other Resources
Well-Known MSBuild Properties
Using PostSharp on a Build Server