How to resolve “Could not load file or assembly Microsoft.CodeAnalysis, version=…” in Visual Studio 2015

Do you find yourself unable to do a “ctrl + .” for code suggestions in VS 2015? An error message comes up saying the following:

Could not load file or assembly ‘Microsoft.CodeAnalysis, version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

For some developers, you can still build and develop but you can’t get “ctrl + .” to work for you. Below are suggestions for fixing this bug.

Option 1:

If you’re working on a web project, ASP.NET uses the nuget package Microsoft.CodeDom.Providers.DotNetCompilerPlatform to update the Microsoft.CodeAnalysis assemblies. So updated the DotNetCompilerPlatform package.

In Visual Studio:

Tools-> Nuget Package Manager -> Package Manager Console

and then type:

Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform

Option 2:

  1. Go to you project folder in Windows Explorer
  2. Delete the packages folder in your Project Folder
  3. Go back to Visual Studio, Right-Click on your solution and select “Restore Nuget Packages”

Option 3:

Update to Visual Studio 2015 Update 3.  Here is a link: Download from here


Kindly indicate the option that works for you in the comment section below.

Leave a Comment