NSubstitute.Analyzers icon indicating copy to clipboard operation
NSubstitute.Analyzers copied to clipboard

NSubstitute.Analyzers.CSharp produces warnings about Microsoft.CodeAnalysis.CSharp in project, no analyzer output

Open erizzo opened this issue 5 years ago • 4 comments

Question I have an ordinary Test project in my solution, targeting .Net Framework 4.6.2. When I added a Nuget reference to NSubstitute.Analyzers.CSharp, I got several warnings like this:

An instance of analyzer NSubstitute.Analyzers.CSharp.DiagnosticAnalyzers.NonVirtualSetupWhenAnalyzer cannot be created from C:\Users\erizzo.nuget\packages\nsubstitute.analyzers.csharp\1.0.6\analyzers\dotnet\cs\NSubstitute.Analyzers.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..

I then tried adding Nuget reference to Microsoft.CodeAnalysis.CSharp (I tried both 2.8.0 and the latest stable version, 2.10.0), but it made no difference.

Obviously, the NSubstitute analyzers are not producing any warnings, either.

Any ideas what I can do?

VisualStudio version is 15.6.7 (VS 2017)

erizzo avatar Mar 13 '19 19:03 erizzo