try-convert icon indicating copy to clipboard operation
try-convert copied to clipboard

Seeing duplicate analyzers after running try-convert

Open KSchlobohm opened this issue 3 years ago • 0 comments

If the analyzers come from package references then the <Analyzer> element should be removed as part of converting to <PackageReference> to prevent duplicating the analyzer.

image

To repro this scenario:

  1. Create a new ASP.NET project with .NET Framework
  2. Add a reference to Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
  3. Run try-convert
  4. Observe the csproj - the <Analyzer> elements for Analyzers.dll and CodeFixes.dll are still present causing the project to see duplicate analyzers.

KSchlobohm avatar Apr 23 '21 21:04 KSchlobohm