I'm trying to install fxcop analyzers in my project. However, having added and restored the nuget package, building the project results in hundreds of warnings of the form
1>CSC : warning CS8032: An instance of analyzer Microsoft.CodeAnalysis.VersionCheckAnalyzer.AnalyzerVersionCheckAnalyzer cannot be created from
C:\<MyProjectPath>\packages\Microsoft.CodeAnalysis.VersionCheckAnalyzer.2.9.3\analyzers\dotnet\Microsoft.CodeAnalysis.VersionCheckAnalyzer.dll :
Could not load file or assembly 'Microsoft.CodeAnalysis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified..
However, if I look in the path packages\Microsoft.CodeAnalysis.VersionCheckAnalyzer.2.9.3\analyzers\dotnet
, I see the dll being mentioned just exists.
Does anyone have any idea what could be going wrong? Maybe some dependency not being met. But if so, how can I tell which? I'm using Visual Studio 2019.