I am writing a Roslyn Analyzer project for .net6.0
and migrating this from a .netstandard2.0
project of the same purpose.
It seems the latest Microsoft.CodeAnalysis
NuGet dependency (a requirement for Analyzers) requires System.Collections.Immutable
6.0.0 and .net6 comes with System.Collections.Immutable
6.0.0 as a default dependency (but they appear to be different version numbers).
It appears when Roslyn tries to run the Analyzer it fails.
Has anyone seen anything similar, or have a solution to make the two different dependencies of the same version number work together?
All this code works correctly in .net standard 2.0 with an older version of System.Collections.Immutable
.
CS8032 An instance of analyzer MyProject.CodeAnalysis.Analyzers.MissingAuthorizeAttribute cannot be created from C:\Git\MyProject\MyProject.CodeAnalysis\bin\Debug\net6.0\MyProject.CodeAnalysis.dll : Could not load file or assembly 'System.Collections.Immutable, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.. MyProject.Common C:\Git\MyProject\MyProject.Common\CSC 1 Active