| Severity | Error |
| Reported by | PostSharp |
| Message | The project configuration provider that the custom attribute ExportProjectAttribute or AssemblyProjectProviderAttribute designates in assembly "<Assembly>" returned a null project configuration. |
Cause
A plug-in of PostSharp is an assembly that extends the PostSharp compiler, written with the PostSharp SDK. PostSharp loads it when a Using element of a configuration file names it, or when the build passes it as an add-in. To read the configuration of the plug-in, PostSharp creates an instance of its project provider, the type designated by the obsolete assembly-level AssemblyProjectProviderAttribute or by ExportProjectAttribute, and calls the GetProjectConfiguration method of its IProjectConfigurationProvider interface.
PostSharp reports PS0142 when this method returns null. <Assembly> is the full path of the plug-in assembly. The message is fatal: the build stops.
This message concerns the development of a plug-in with the PostSharp SDK, and its text contains the path of a file of the build, so no example can show it.
Resolution
- If you develop the plug-in, make
GetProjectConfigurationreturn a project configuration in every case. When the plug-in defines its tasks withExportTaskAttributeand its services withExportServiceAttribute, it does not need a project provider: remove it. - If the plug-in comes from a third party, make sure that the plug-in was built for this version of PostSharp, and ask its vendor for an update.
- If you do not need the plug-in, remove the
Usingelement that imports it from thepostsharp.configfile. See Configuration File Schema Reference.
See Also
Other Resources
Configuration File Schema Reference
Configuring Projects Using postsharp.config