question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not load file or assembly Microsoft.CodeAnalysis

See original GitHub issue

Hi 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.

image

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:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
randalvancecommented, Sep 5, 2020

I opened a separate issue in Jetbrains. https://youtrack.jetbrains.com/issue/RIDER-50473

0reactions
cezarypiatekcommented, Sep 12, 2020

This is what I’ve got from VisualStudio 16.7.2 + R# 2020.2

image

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:

image

The same option should be available in the Rider

image

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

image

I really would like to help you but I can’t reproduce this issue.

Here’s my list of installed sdks image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found