I have a .sln solution of multiple projects, all for the .NET Framework 4.6, nothing with .NET Core. Now I've added a new web project using ASP.NET Core, still targeting the .NET Framework 4.6. The PowerShell-based build script includes a NuGet package restore that is called like this:
nuget.exe restore $solutionFile -NonInteractive
This fails with the following message:
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'. C:\GitLabCI\builds\024ca24f\0\team\MyTeam\src\MyWeb\MyWeb.xproj(7,3): error MSB4019: Das importierte Projekt "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" wurde nicht gefunden. Vergewissern Sie sich, dass der Pfad in der -Deklaration korrekt und die Datei auf dem Datenträger vorhanden ist. System.Management.Automation.RemoteException
A support file of MSBuild seems to be missing. I can't install the ASP.NET Core tools however because they insist on requiring the full Visual Studio 2015 IDE installed on the build server which is insane and I don't want to do that. Everything else can be installed for minimal footprint, the build tools and the framework.
If I leave out the NuGet package restore, the build fails because the assemblies are missing, obviously.
How can I install MSBuild support for ASP.NET Core 1.0 RTM without the full VS IDE?
Update: I copied the two directories DotNet
and DotNet.Web
from C:\Program Files (x86)\MSBuild\VisualStudio\v14.0 to the build server machine. NuGet package restore worked then, but the build fails with the following message for a number of projects:
C:\GitLabCI\builds\024ca24f\0\team\MyTeam\src\Common\Common.csproj : error MSB4057: Das Ziel "_GenerateDependencyFragmentJson" ist im Projekt nicht vorhanden.
Roughly translates as "The target '_GenerateDependencyFragmentJson' does not exist in the project." Google does not even know that word.
I am aware that blindly copying files from one machine to another is not a good thing to do, and I didn't expect this to work. At least it produces later error messages.