Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot build .net core 1.1 with msbuild tools

I have a .net core class library I am attempting to build into a nugget package. however, on my build server (running team city), I am getting the following error:

C:\TeamCity\buildAgent\work\3c6531587491c25e\MySolution\MyProject.csproj error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

When I look in this directory, I ma missing the "Microsoft.NET.Sdk" folder from my build server. where do I get these tools without having to install visual studio?

Thanks!

like image 983
Nathan Tregillus Avatar asked Apr 04 '17 19:04

Nathan Tregillus


1 Answers

See the tracking issue on GitHub: https://github.com/Microsoft/msbuild/issues/1697

If you don't want to touch your build tools installation (by copying SDK files), you can also set the MSBuildSDKsPath environment variable to the location of the SDKs carried in the .net CLI (usually C:\Program Files\dotnet\sdk\1.0.0\Sdks\)

like image 51
Martin Ullrich Avatar answered Oct 30 '22 16:10

Martin Ullrich