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

Shivani Sarin 1 Reputation point Microsoft Employee
2021-12-20T21:48:24.1+00:00

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

I don't see this issue locally, but when I am running on a fresh windows container with latest 2019 installed I am running into this issue.

I tried following https://learn.microsoft.com/en-us/answers/questions/244179/microsoftcodeanalysis-problem.html and added Microsoft.CodeAnalysis.Compilers and Microsoft.Net.Compilers= and I still run into this issue.

Does <PackageReference Update="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="3.6.0" /> package have anything to do with the above 2 nuget packages.

This is the docker image to build the project cdpxwin1809.azurecr.io/global/vse2019:latest

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,160 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 31,326 Reputation points Microsoft Vendor
    2021-12-21T02:19:49.76+00:00

    Hi @Shivani Sarin ,
    The following actions might be helpful.

    • Update the CodeDom assembly from NuGet
    • Update Visual Studio

    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.