Could not load file or assembly Microsoft.CodeAnalysis
See original GitHub issueHi Cezary,
We are unable to make this work even for a brand new C# console project. We are currently receiving the following error.
An instance of analyzer CSharpExtensions.Analyzers3.NotNullablePropertyInitializationDiagnosticSuppressor cannot be created from C:\Users\racu\.nuget\packages\smartanalyzers.csharpextensions.annotations\2.5.65\analyzers\dotnet\cs\CSharpExtensions.Analyzers3.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
The non-nullable properties are still being marked with a warning and we suspect it is of the error above.
Note:
We are able to build the project with dotnet build
without any problems.
We also tried installing Microsoft.CodeAnalysis
version 3.5.0.0
to the project but we are still receiving the error.
Do you have any ideas on how to resolve this issue?
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Could not load file or assembly 'Microsoft.CodeAnalysis ...
I'm getting this today as well...I wish I knew what broke it! Our build machine has the same VS/C# versions and its Ctrl+'.'...
Read more >Could not load file or assembly 'Microsoft.CodeAnalysis ...
Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Could not load file or assembly 'Microsoft.
Read more >Could not load file or assembly 'Microsoft.CodeAnalysis ...
The system cannot find the file specified.... I don't see this issue locally, but when I am running on a fresh windows container...
Read more >Microsoft.CodeAnalysis problem
CodeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Culture=neutral, PublicKeyToken= ...
Read more >Microsoft.Extensions.Logging.Generators.dll: Could not ...
1). Delete the hidden .vs folder in solution folder and rebuild your project. 2). Tools > Options > NuGet Package Manager > General...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I opened a separate issue in Jetbrains. https://youtrack.jetbrains.com/issue/RIDER-50473
This is what I’ve got from VisualStudio 16.7.2 + R# 2020.2
It looks like R# has own analyzer related to the nullable types and it’s not supporting Roslyn suppressor but there’s an option to disable it:
The same option should be available in the Rider
I have no idea why your VS is not reporting
CSE001
- probably this is caused by your local setup (maybe the installation is corrupted).On my machine is working correctly with VS, RIder and don’t CLI
I really would like to help you but I can’t reproduce this issue.
Here’s my list of installed sdks