PostSharp6.6//Deployment and Configuration/Licensing/License Types/Post­Sharp Community

PostSharp Community

PostSharp Community is a free edition of PostSharp that includes both free and premium features. Free features are available in unlimited amount. However, premium features can only be applied to 1,000 lines of code.

Note that any edition of PostSharp includes the free entitlements of PostSharp Community additionally to the premium features covered by this edition.

This topic contains the following sections:

Free features

The following features of PostSharp are free and unlimited in PostSharp Community:

Method decorators and interceptors

Both aspects OnMethodBoundaryAspect and MethodInterceptionAspect can be used for free, but semantic advising of async methods is a premium feature.

To disable semantic advising, you have to set the SemanticallyAdvisedMethodKinds property to None in the aspect constructor.

INotifyPropertyChanged

The NotifyPropertyChangedAttribute can be used for free - but only for auto-implemented property. Instrumenting explicit properties is a premium feature.

Explicit properties are instrumented by default. To limit PostSharp to instrument only automatic properties, you can set the ExcludeExplicitProperties property to true.

Contracts

All contracts can be used for free without limitation. See Contracts for details.

PostSharp Logging, Developer Mode

You can apply logging to any code size using PostSharp Community, but you need to explicitly enable the developer mode. Otherwise, production mode will be used, which is considered a premium feature.

To enable development mode, set the LoggingDeveloperMode property to true in postsharp.config. See Configuring Projects Using postsharp.config for details.

PostSharp SDK

You can create your own add-ins, or use community add-ins, that use the lower layers of PostSharp SDK. Integrating with higher levels (Aspect Weaver) is a premium feature covered by PostSharp Framework or PostSharp Ultimate. This premium feature is not provided at all by PostSharp Community.

Enforcement of the solution-level limit

You can find more information about how we count lines of code in Number of Enhanced Lines of Code.

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

Diagnosing licensing issues

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

msbuild /t:Rebuild /v:detailed /p:PostSharpTrace=Licensing > msbuild.log