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
Can't build project from command line after upgrading to .NET Core 2.1 #9632
Comments
I have put together a Gist of my project setup with the same edited names as the build log: https://gist.github.com/briman0094/67f33bbb60b6f9ddef894a68e7b5c97a |
You shouldn't do this. Use global.json if you want to pin the SDK to 2.1.302. |
You are ending up with the tools from SDK 2.1.400-preview-009063 but the Microsoft.NET.Sdk tasks and targets from SDK 2.1.302, and msbuild node reuse isn't letting the 2.1.400-* and 2.1.302 tasks load into the same process. First thing to do, stop setting MSBuildSdksPath. Then your options are:
|
I think you can also hit this error when switching between certain .NET Core SDK versions that share the same msbuild version, even without setting MSBuildSdksPath. And that would be due to dotnet/msbuild#3572. The fix for that would also have prevented this particular error in this case of MSBuildSdksPath set to another SDK location, but that's still not a supported configuration. There is also #2161 where you can hit related issues on desktop msbuild / VS. If you encounter the error and haven't set MSBuildSdksPath, then you can try I'm therefore closing this as being tracked by those two bugs in the cases where it's failing without MSBuildSdksPath being set. |
I just installed the latest .NET Core 2.1 SDK (2.1.302) from the Microsoft website, updated my 4 project files to use
netcoreapp2.1
, and updated all NuGet packages from within Visual Studio 2017 (15.8.0 Preview 4). I can build and run the project fine using Visual Studio, but I can't use anydotnet
CLI commands now. I have trieddotnet restore
,dotnet build
, and severaldotnet ef
commands, and they all result in aBuild FAILED
message with the following output:My solution has 4 projects. The main project is a
Microsoft.NET.Sdk.Web
project. The project reference tree looks like this:I am calling
dotnet build
in the folder containingWEB_PROJECT
. I have tried clearing out allbin
andobj
folders to no avail. I have updated myMSBuildSdksPath
to point toC:\Program Files\dotnet\sdk\2.1.302\Sdks
.Environment data
dotnet --info
output:The text was updated successfully, but these errors were encountered: