I installed Build Tools for Visual Studio 2017 and tried to build the DiscUtils solution with:
& "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" DiscUtils.sln
I get for all 51 C# projects:
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 <Import> declaration is correct, and that the file exists on disk.
At the time of writing, the VS 2017 Build Tools are missing critical components necessary for building SDK-based ("new-world") csproj files (to be specific: the SDKs and integrated NuGet are missing).
See this GitHub issue for tracking and a few workarounds: https://github.com/Microsoft/msbuild/issues/1697
In short MSBuild is broken, see @Martin Ullrich.
To build use:
choco install dotnetcore-sdk
& "C:\Program Files\dotnet\dotnet.exe" restore DiscUtils.sln
& "C:\Program Files\dotnet\dotnet.exe" msbuild DiscUtils.sln -p:FrameworkPathOverride="c:\Windows\Microsoft.NET\Framework64\v4.0.30319"
If you don't use Chocolatey, download manually the .NET Core SDK
FrameworkPathOverride
is necessary if you don't have Visual Studio. VS solutions expects to find reference assemblies in:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v*
Without VS, you can resort to those in c:\Windows\Microsoft.NET\Framework64\v4.0.30319
Note that, if the solutions generates different assembly for different targets frameworks and you need them, you need to install related SDKs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With