Could not load file or assembly 'Microsoft.CodeAnalysis, version= 1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependenc

前端 未结 16 1356
死守一世寂寞
死守一世寂寞 2020-11-29 05:18

An update occurred last night and now I find myself unable to do a ctrl + \'.\' for code suggestions in VS 2015. An error message comes up saying the following:

相关标签:
16条回答
  • 2020-11-29 05:31

    I had the same problem with Visual Studio 2015 Update 2, to solve the problem globally for all solutions, update to Visual Studio 2015 Update 3. Here is a link: Download from here

    0 讨论(0)
  • 2020-11-29 05:34

    To solve this problem for all solutions, I needed to install the assembly Microsoft.CodeAnalysis.dll directly to the GAC – Global Assemblies Cache.

    I got the file Microsoft.CodeAnalysis.dll from C:/Users/[user]/.nuget/packages/Microsoft.CodeAnalysis.Common/1.3.2/lib/portable-net45+win8/Microsoft.CodeAnalysis.dll.

    To install the assembly to the GAC, I used a PowerShell script from https://github.com/LTruijens/powershell-gac.

    Finally, I managed to install the assembly to the GAC with the following command from PowerShell:

    Add-GacAssembly [myPath]\Microsoft.CodeAnalysis.dll
    
    0 讨论(0)
  • 2020-11-29 05:36

    I have solved the problem this way:

    Update Visual studio 2015 to Update 3

    from the menu chose View => Notifications => Visual Studio Update 3 and clicked the update button.

    0 讨论(0)
  • 2020-11-29 05:36

    I was also facing same issue, Try installing Microsoft.CodeAnalysis.CSharp nuget package. And if its not resolved, check version of Microsoft.Net.Compilers in your project, I was having version as 1.0.0 which was causing issue so updated Microsoft.Net.Compilers nuget to v1.3.2.

    Found solution here : Github discussion

    0 讨论(0)
  • 2020-11-29 05:38

    As pointed out by @CaptainAmerica the solution is to update the CodeDom assembly from NuGet. One should point out how to do this in Visual Studio. I found the solution here:

    https://www.nuget.org/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform/

    Basically, in the Visual Studio menu select:

    Tools-> Nuget Package Manager -> Package Manager Console

    In the console that appears at the bottom of Visual Studio run this command:

    Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
    
    0 讨论(0)
  • 2020-11-29 05:39

    I got the same problem, I am using VS2017 and installed Microsoft.EntityFrameworkCore.SqlServer 3.1.8, while in my VS2017 .Net core version is 2.1 So I downgraded my Microsoft.EntityFrameworkCore.SqlServer to 2.1.1 and restarted the solution.

    The warning was gone !!

    0 讨论(0)
提交回复
热议问题