dotnet / roslynator

Roslynator is a set of code analysis tools for C#, powered by Roslyn.

Home Page:https://josefpihrt.github.io/docs/roslynator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CS8032: An instance of analyzer Roslynator.CSharp.Analysis.UnnecessaryRawStringLiteralAnalyzer cannot be created

khellang opened this issue · comments

Product and Version Used:

  • Roslynator.Analyzers 4.10.0
  • Visual Studio 2022 17.8.7

Steps to Reproduce:

We have a sln with two .NET 8, three .NET Standard 2.0 projects and a single non-SDK-based csproj, targeting .NET Framework 4.8. When updating Roslynator.Analyzers to version 4.10.0 in our Directory.Build.props file across the entire solution, we're now getting this build error for the .NET Framework project.

Actual Behavior:

Getting a build error:

CS8032: An instance of analyzer Roslynator.CSharp.Analysis.UnnecessaryRawStringLiteralAnalyzer cannot be created from E:\PackageCache\NuGet\roslynator.analyzers\4.10.0\analyzers\dotnet\roslyn4.7\cs\Roslynator.CSharp.Analyzers.dll : Could not load type 'Roslynator.CSharp.Analysis.UnnecessaryRawStringLiteralAnalyzer' from assembly 'Roslynator.CSharp.Analyzers, Version=4.10.0.0, Culture=neutral, PublicKeyToken=926ea54d246a765e'..

Expected Behavior:

No build error?

@khellang Could you use nugets from PR and load it from local nuget to see if it helps?

I can confirm that does indeed fix the error we're seeing, @josefpihrt. Thank you 🙏