Open sandboxFocusImprove this doc

PS0243: Premium Features Exceed the Free Limit

Severity Error
Reported by PostSharp
Message The project uses premium features that no license covers. These features may enhance types with a total of at most <MaxLinesOfCode> lines of code in the <Scope>, but <LinesOfCode> lines of code were enhanced. Register a license that covers these features, or reduce their use.

Cause

PostSharp Essentials, the free edition, lets you use premium features on a limited amount of code: 1,000 lines of code in a project, and 1,000 lines of code in the project and all the assemblies that it references. Any license grants the features of PostSharp Essentials in addition to its own, so this limit also applies to the premium features that your license does not cover.

When PostSharp applies an aspect that requires a premium feature, and no license of the build covers this feature, PostSharp does not fail: it records the type that the aspect enhances. At the end of the build, PostSharp adds up the lines of code of these types, as licensing-counting-lines describes, and reports PS0243 when the total is over the limit:

  • <Scope> is project when the types of the current project exceed the limit, and solution when the total of the current project and of the assemblies that it references exceeds it. PostSharp records the count of each assembly when it builds it, so the total of a solution includes the projects that the current project references.
  • <MaxLinesOfCode> is the limit, and <LinesOfCode> the number of lines of code enhanced by uncovered premium features.

PostSharp reports the message on the assembly. Before PS0243, PostSharp reports one message for each premium package that the project used without a license, which names the products that cover it: PS0127, or PS0242 when PostSharp found no license at all.

This message depends on the license of the build, so no example can show it.

Resolution

  • Register a license that covers the premium features that the project uses. The messages that PostSharp reports with PS0243 name the products that cover them. See Deploying License Keys.
  • Reduce the use of premium features, for example by disabling the semantic advising of async methods, by instrumenting only the auto-implemented properties with NotifyPropertyChanged, or by enabling the developer mode of PostSharp Logging. PostSharp Essentials lists the free and premium features.
  • When you expected your license to cover the project, check that PostSharp uses it: an expired or rejected key is reported by PS0301 or PS0304 earlier in the build.

To see which types count against the limit, capture the licensing trace with the PostSharpTrace=Licensing MSBuild property, as PostSharp Essentials and License Troubleshooting describe: when the project exceeds the limit, the trace lists the enhanced types.

See Also

Other Resources

PostSharp Essentials
licensing-counting-lines
License Troubleshooting
Deploying License Keys