Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Include code analyzers in a nuget package

$
0
0

I currently have 25+ repositories to maintain. For all these repositories I would like to add Code Analysis using Roslyn analyzers.

Because I want to have to control over the analyzers that are being used from one central location. My idea was to create a NuGet package which is referencing all the analyzers that I need. However, this seems not to be working.

My NuGet package now looks like this:

<ItemGroup>
    <PackageReference Include="SonarAnalyzer.CSharp" Version="8.3.0.14607">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>

And the nuget package is referenced like this:

<PackageReference Include="NuGet.Package" Version="1.0.0" />

The analyzer SonarQube.CSharp doesn't appear in the list of analyzers in the parent project.

Should this work? And how should I change it to make this work?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>