Limitations of PostSharp Express

PostSharp Express contains almost 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.

Enforcement of the solution-level limit

The limitation of 50 types per solution is implementing 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.

Backward compatibility with PostSharp 4.2

Limitations of PostSharp Express changed between PostSharp 4.2 and PostSharp 4.3. If PostSharp detects that the project has been upgraded from PostSharp 4.2 or earlier, the limitations of PostSharp Express 4.2 will be enforced in a backward-compatible way. Please refer to PostSharp 4.2 documentation for details about PostSharp Express limitations in this version.

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.