-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Microsoft.Build.Evaluation.Project Constructor throws an exception when dotnet sdk 5.0.100 is installed. #6026
Comments
Issue moved from dotnet/dotnet-api-docs#5143
From @Dotnet-GitSync-Bot on Wednesday, November 25, 2020 9:13:43 AM I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Issue moved from dotnet/dotnet-api-docs#5143
From @gewarren on Tuesday, January 12, 2021 7:14:52 PM cc @ghogen @rainersigwald. Should I move this issue here? https://github.com/dotnet/msbuild/issues |
Issue moved from dotnet/dotnet-api-docs#5143
From @ghogen on Tuesday, January 12, 2021 7:17:42 PM @gewarren @rainersigwald Agreed - looks like a product bug report that should be moved to the MSBuild repo. |
@WenyunZou what version of .NET Core is your application targeting? This sounds like a 3.1 application trying to load a 5.0 SDK. |
Hi,
It is
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
I used the below to solve my problem.
MSBuildLocator.RegisterMSBuildPath(msbuildPath);
|
Are you using the most recent version of MSBuildLocator? microsoft/MSBuildLocator#106 has a fix for this specific issue. |
I'm assuming updating MSBuildLocator resolved the problem? If not, let me know, and I can reopen this. |
Issue moved from dotnet/dotnet-api-docs#5143
From @WenyunZou on Wednesday, November 25, 2020 9:13:21 AM
Hi,
Api at https://docs.microsoft.com/en-us/dotnet/api/microsoft.build.evaluation.project.-ctor?view=msbuild-16-netcore
If I'm opening the issued at a wrong place, please help me to redirect it. Thank you!
Description:
It had been working fine until I installed dotnet sdk 5.0.100 recently. The constructor of Microsoft.Build.Evaluation.Project throws an exception "MSBuild.CouldNotLoadSdkResolver".
Code:
Project project = new Project(projectFilePath);
Exception:
The SDK resolver type "WorkloadSdkResolver" failed to load. Could not load file or assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
StackTrace:
Repro Steps:
The text was updated successfully, but these errors were encountered: