4

I have a C# project (ProjectX) that I am trying to upgrade from using .NET Standard 2.0 framework to .NET 6.0. The upgrade seemingly goes smoothly and we package it into a nuget using GitLab. Now when I reference the updated package from another project (already upgraded to .NET 6.0) I get the following warning:

Warning CS8032 An instance of analyzer {class inheriting from Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer} cannot be created from ProjectX.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..

Everything I've read suggests that this is likely caused when the sdk isn't on the same version as the source generator but as far as I can tell, this not the case.

I've tried adding the Systems.Collections.Immutable package directly to ProjectX also with no luck.

John M
  • 41
  • 1

1 Answers1

1

I Fixed this bij downgrading 2 nugate packages in my code analyzer:
Microsoft.CodeAnalysis.CSharp to 3.8.0
icrosoft.CodeAnalysis.CSharp.Workspaces to 3.8.0

Connor Stoop
  • 1,574
  • 1
  • 12
  • 26