Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0 #5192

Closed
megactek opened this issue Mar 23, 2020 · 9 comments
Closed
Labels
closed-by-bot Closed due to lack of activity needs-more-info Issues that need more info to continue investigation. stale For issues that haven't had activity in some time. triaged

Comments

@megactek
Copy link

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.Build.CommandLine.MSBuildApp' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Microsoft.Build.CommandLine.MSBuildApp..cctor()
--- End of inner exception stack trace ---
at Microsoft.Build.CommandLine.MSBuildApp.Main()

@itrice
Copy link

itrice commented Mar 24, 2020

Yes there have another issue, maybe the same issue. #5193

@megactek
Copy link
Author

Every time i try to build a code and debug it keeps popping this error on the command-line and later will output build 0 - successful 1 - skipped
then microsoft visual studio will prompt error in build, run previous version?

@rainersigwald
Copy link
Member

If you're encountering this problem (@megactek @itrice), can you please download and run https://github.com/microsoft/msbuild/blob/2d82e1a861d890fce68c8e2d42b569e5bbaf5687/scripts/EnumerateMSBuild.ps1 and share the results? You might have a Visual Studio installation problem, or you might have MSBuild assemblies in your Global Assembly Cache (GAC). If it's the latter, the instructions from this feedback issue might help you.

@marakonec
Copy link

marakonec commented Apr 10, 2020

Hello I have the same problem.

Exception has been thrown by the target of an invocation. The project file could not be loaded. Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

The error occurs when I execute the nuget restore command. Nuget version 4.6.2. I have two ways to solve this problem.

  1. Use Nuget 4.8.2 and higher.
  2. gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Build.Framework.dll

But I need a different solution. If the version of msbuild is lower than 16.5 - everything is correct.

Enumerate MSBuild result attached.
msbuild_versions.txt

@newCoderNovice
Copy link

@rainersigwald here is the result of the run:
msbuild_versions.txt

@rainersigwald
Copy link
Member

The error occurs when I execute the nuget restore command. Nuget version 4.6.2.

@megactek This should be resolved by #5257 in Visual Studio 2019 16.5.5.

@rainersigwald
Copy link
Member

@newCoderNovice can you describe what you're doing when this happens?

@benvillalobos benvillalobos added needs-more-info Issues that need more info to continue investigation. and removed more-info-needed labels Jun 8, 2021
@ghost ghost added the stale For issues that haven't had activity in some time. label Aug 28, 2021
@ghost
Copy link

ghost commented Aug 28, 2021

This issue is marked as stale because feedback has been requested for 30 days with no response. Please respond within 14 days or this issue will be closed due to inactivity.

@ghost ghost closed this as completed Sep 11, 2021
@ghost
Copy link

ghost commented Sep 11, 2021

This issue was closed due to inactivity. If you can still reproduce this bug, please comment with the requested information, detailed steps to reproduce the problem, or any other notes that might help in the investigation.

@ghost ghost added the closed-by-bot Closed due to lack of activity label Sep 11, 2021
@AR-May AR-May added the triaged label Feb 21, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-by-bot Closed due to lack of activity needs-more-info Issues that need more info to continue investigation. stale For issues that haven't had activity in some time. triaged
Projects
None yet
Development

No branches or pull requests

8 participants