This is the online documentation for PostSharp 5.0.
Download PDF or CHM. Go to v4.3 or v5.0

Limitations of PostSharp Express

PostSharp Essentials contains all the features of PostSharp Ultimate, but the number of types to which you can apply aspects is limited to 10 per project or 50 per solution.

To know how many types are already using aspects, open the PostSharp Metrics tool window in Visual Studio.

This topic contains the following sections:

Limitations of PostSharp Architecture Framework

PostSharp Architecture Framework has no concept of aspect and no concept of aspect target, therefore the number of types is computed differently. Instead, what is limited is the number of types for which you can call APIs like ReflectionSearch or ISyntaxReflectionService.

Limitations of PostSharp Diagnostics

There is no limit on the number of types to which you can apply aspects of the PostSharp.Patterns.Diagnostics namespace. However, when using PostSharp Essentials, your application will emit log records only one day after it has been built. After this period, your application will still work normally, but log records will no longer be emitted.

See Licensing of PostSharp Diagnostics for details.

Enforcement of the solution-level limit

The limitation of 50 types per solution is implemented not by looking at the sln file, but by counting the number of classes in all assemblies that are referenced by the current assembly. That is, the limit is actually 50 types in the whole assembly closure.

Diagnosing licensing issues

If PostSharp is requiring a commercial license and you don't understand why, you can generate a licensing diagnostic log by building your project with the following command line:

msbuild /p:PostSharpTraceLicensing=True

If you're calling the PostSharp command-line interface instead of the MSBuild integration, add the /TraceLicensing argument.

The log file is created in the %ProgramData%\PostSharp\LicensingTrace directory. The full path to the log file is mentioned in the build output.