Roslyn - Packaging your analyzer




Update :
If you find yourself doing this, you are probably not using Extensibility template (Analyzer + VSix solution). In that case, please take some time before you go down this "rabbit hole".




There are 2 ways you can package your anaylzer as nuget package. I am assuming you are trying to deploy this as .Net standard. I specifically target Net 1.3 standard.

Analyzers are packaged differently, as we are required to place it under, \analyzer\dotnet\cs folder. 


1. csproj - you need to add this in your solution file.

(Notice i change my packagePath="" = empty string, if you deploy to .netcore project, it is all good. If you try to deploy to .net framework, you might not be able to install it.



     


And not forgetting - this basically omit generation of dll. If you don't do this, your analyzer will be installed as any dll package instead of anaylzer.



2. nuget (will cover this later, till then try reading it from https://roslyn-analyzers.readthedocs.io/en/latest/nuget-packages.html


Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm