PostSharp 5.0 preview with .NET Core RTM

This article describes how to use PostSharp 5.0.22-preview with .NET Core RTM Project. The same instructions apply for a newer version.

All PostSharp .NuGet packages except PostSharp.Patterns.Caching(.Redist) are ready to be used with the new MSBuild project system, including .NET Core and .NET Standard projects.

All packages have been split into tools and libraries (redistributables), so each former package has now its redistributable sibling with a suffix ".Redist" in its name. In the new MSBuild project system coming with Visual Studio 2017, it is possible to distinguish such references. To take advantage of it, use the following way to reference PostSharp in your projects:

<ItemGroup>
    <PackageReference Include="PostSharp" Version="5.0.22-preview">
      <PrivateAssets>All</PrivateAssets>
    </PackageReference>
    <PackageReference Include="PostSharp.Redist" Version="5.0.22-preview" />
</ItemGroup>

For the Diagnostics Pattern library, see http://support.sharpcrafters.com/kb/postsharp-50-preview/postsharp-....

After referencing PostSharp as a Package Reference, PostSharp will be included in your project and you can use its features.

If you use Visual Studio to develop your projects, please make sure you have the latest preview of PostSharp Visual Studio Extension.

NOTICE: If you don’t have a PostSharp license installed on your machine, the first build will not run correctly and you’ll be prompted to register the license on your machine.