try-convert
try-convert copied to clipboard
Seeing duplicate analyzers after running try-convert
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.
To repro this scenario:
- Create a new ASP.NET project with .NET Framework
- Add a reference to
Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
- Run try-convert
- Observe the csproj - the <Analyzer> elements for Analyzers.dll and CodeFixes.dll are still present causing the project to see duplicate analyzers.