I have a DiagnosticAnalyzer
and a CodeFixProvider
in a class library, In other words a Roslyn Analyzer. I can Nuget package or Vsix package it but I never plan to publish it and I only need to use it in an single mono solution. I was hoping that simply adding the class library as a reference would treat the class library as an "Analyzer" like it would being Nuget installed but it doesn't. Is it possible to use the DiagnosticAnalyzer
from the same solution?
You can add an analyzer by referencing a dll, which should work with one you've built yourself.
Edit:
For .NET Core and .NET Standard projects that don't have tooling as stated here manually add this snippet to your .csproj
<ItemGroup>
<Analyzer Include="path\to\Analyzer.dll" />
</ItemGroup>