Skip to content

Converts all JetBrains ReSharper code annotation attributes to External Annotations, so you can provide R# annotations to 3rd parties but don't need to deploy JetBrainsAnnotations.dll.

License

Notifications You must be signed in to change notification settings

jpeirson/JetBrainsAnnotations.Fody

 
 

Repository files navigation

Chat on Gitter NuGet Status Badge

This is an add-in for Fody

Icon

Converts all JetBrains ReSharper code annotation attributes to External Annotations, so you can provide R# annotations to 3rd parties but don't need to deploy JetBrainsAnnotations.dll.

The nuget package

https://nuget.org/packages/JetBrainsAnnotations.Fody/

PM> Install-Package JetBrainsAnnotations.Fody

What are JetBrains Annotations

The assembly JetBrainsAnnotations.dll is shipped as a nuget package. It provides standard JetBrains ReSharper code annotation attribute implementations. This allows you to better leverage the ReSharper intellisense.

To provide the annotations to 3rd parties you must define JETBRAINS_ANNOTATIONS to include the attributes in your assembly. However now you have a reference and would need to ship the JetBrainsAnnotations.dll with your product.

This Fody plugin converts all attributes to an external annotations XML file on the fly, so you can ship just the text file with your assembly and don't need to reference JetBrainsAnnotations.

For more information

What it actually does to your assembly

  • For each attribute defined in JetBrainsAnnotations.dll it adds an entry to your assemblies external annotations XML file and removes the usage of the attribute from your assembly.
  • Removes the reference to JetBrainsAnnotations.dll

What it actually does to your project

  • Updates <project name>.ExternalAnnotations.xml every time you compile.

    NOTE: To make your annotations available to 3rd parties, you must ship this file along with the assembly.

  • If your project is set to generate an XML documentation file, the documentation is extended with the annotation attributes.

What you may need to change manually

  • Add the <project name>.ExternalAnnotations.xml to your project manually and mark it as content + copy to output.
  • Mark the reference to Jetbrains.Annotations.dll as Copy Local => False, so it won't get copied to your target directory and eventually get picked up by installers.
  • If you deploy your project as a NuGet package, add developmentDependency="true" to the JetBrains.Annotations package entry in your projects packages.config files, else NuGet will list JetBrains.Annotations as a dependency of your package:
    <package id="JetBrains.Annotations" version="11.0.0" targetFramework="net452" developmentDependency="true" />
    or if you are using a PackageReference in your project files, mark it as private assests:
    <PackageReference Include="JetBrains.Annotations" Version="*">
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>

Icon

Fighter Jet designed by Luke Anthony Firth from The Noun Project.

About

Converts all JetBrains ReSharper code annotation attributes to External Annotations, so you can provide R# annotations to 3rd parties but don't need to deploy JetBrainsAnnotations.dll.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%