Reputation: 5025
I have a fresh Windows 10 installation wih VS2017 installed.
VisualStudio is closed. After calling nuget restore xxx.sln
I get the following error message:
D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.client\nestle.zls.clientSetup\nestle.zls.clientSetup.wixproj : error MSB4057: Das Ziel "_IsProjectRestoreSupported" ist im Projekt nicht vorhanden.
D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.leitstand\nestle.zls.leitstandSetup\nestle.zls.leitstandSetup.wixproj : error MSB4057: Das Ziel "_IsProjectRestoreSupported" ist im Projekt nicht vorhanden.
D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.server\nestle.zls.serverSetup\nestle.zls.serverSetup.wixproj : error MSB4057: Das Ziel "_IsProjectRestoreSupported" ist im Projekt nicht vorhanden.
D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.setup.common\nestle.zls.setup.common.wixproj : error MSB4057: Das Ziel "_IsProjectRestoreSupported" ist im Projekt nicht vorhanden.
D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.client\nestle.zls.clientSetup\nestle.zls.clientSetup.wixproj : warning NU1503: Skipping restore for project 'D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.client\nestle.zls.clientSetup\nestle.zls.clientSetup.wixproj'. The project file may be invalid or missing targets required for restore. [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.leitstand\nestle.zls.leitstandSetup\nestle.zls.leitstandSetup.wixproj : warning NU1503: Skipping restore for project 'D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.leitstand\nestle.zls.leitstandSetup\nestle.zls.leitstandSetup.wixproj'. The project file may be invalid or missing targets required for restore. [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.server\nestle.zls.serverSetup\nestle.zls.serverSetup.wixproj : warning NU1503: Skipping restore for project 'D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.server\nestle.zls.serverSetup\nestle.zls.serverSetup.wixproj'. The project file may be invalid or missing targets required for restore. [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.setup.common\nestle.zls.setup.common.wixproj : warning NU1503: Skipping restore for project 'D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.setup.common\nestle.zls.setup.common.wixproj'. The project file may be invalid or missing targets required for restore. [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: Unerwarteter Fehler bei der WriteRestoreGraphTask-Aufgabe. [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: System.ArgumentException: '1.0.0-pre.19.ci_server-test.2575d08' is not a valid version string. [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: Parametername: value [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: bei NuGet.Versioning.NuGetVersion.Parse(String value) [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: bei NuGet.Commands.MSBuildRestoreUtility.GetVersion(IMSBuildItem item) [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: bei NuGet.Commands.MSBuildRestoreUtility.GetPackageSpec(IEnumerable`1 items) [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: bei System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: bei NuGet.Commands.MSBuildRestoreUtility.GetDependencySpec(IEnumerable`1 items) [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: bei NuGet.Build.Tasks.WriteRestoreGraphTask.Execute() [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\qwa5r5sc.k3u.nugetrestore.targets(133,5): error MSB4018: bei Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [C:\Users\adm-nuc\AppData\Local\Temp\NuGetScratch\c2aijht0.m2r.nugetinputs.targets]
WARNUNG: Error reading msbuild project information, ensure that your input solution or project file is valid. NETCore and UAP projects will be skipped, only packages.config files will be restored.
Alle in "packages.config" aufgeführten Pakete sind bereits installiert.
Now I open VisualStudio and load the project xxx.sln
file and call the nuget restore
cmd again, everything is fine:
D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls>nuget restore nestle.zls.sln
MSBuild auto-detection: using msbuild version '15.9.20.62856' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
Alle in "packages.config" aufgeführten Pakete sind bereits installiert.
Committing restore...
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.mes\obj\project.assets.json
Restore completed in 70,66 ms for D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.mes\nestle.mes.csproj.
Assets file has not changed. Skipping assets file writing. Path: D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.common\obj\project.assets.json
Restore completed in 71,14 ms for D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.common\nestle.common.csproj.
Committing restore...
Assets file has not changed. Skipping assets file writing. Path: D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.server\nestle.zls.server\obj\project.assets.json
Restore completed in 80,07 ms for D:\Runner-Build-Directory\4b2335f7\0\customers\nestle\nestle-zls\nestle.zls.server\nestle.zls.server\nestle.zls.server.csproj.
NuGet Config files used:
C:\Users\adm-nuc\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
http://nuget.ad.xxx.de/
https://api.nuget.org/v3/index.json
https://www.nuget.org/api/v2
I have installed the same VisualStudio packages and set exactly the same envirenment variables/path than on our first build server but I can't get it working. Someone knows this behavior?
So if trying to build the project is exactly the same problem. Error messages and after loading the project in vs, everything is working as excepected!
Upvotes: 4
Views: 7074
Reputation: 1255
adding this flag should help as nuget.exe utility searches for the latest msbuild which may not always work. Using the one as VS gives you the right level of certainty.
nuget restore xxx.sln -msbuildpath <your msbuild path>
example:
nuget restore myProject.csproj -Source https://NuGet.org/api/v2/ -msbuildpath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
Upvotes: 0
Reputation: 5025
The problem is solved, but I cannot explain what was the cause in detail.
To solve the error messages I have rebuild the nuget files with dotnet
. But then I couldn't fetch the git branches.. so I went further and saw that my server where the own nuget package stream and git was running, had no disc space left. I cleaned the hdd and I could build it without any errors.
So I think this was part of the errors and the strange behavior..
Upvotes: -1
Reputation: 76996
MSBuild fails, but after loading project in VisualStudio it works with MSBuild
I have already reported the same issue to the nuget team, then I have received the following reply:
This message is expected, but it should not block your restore.
In the future once msbuild provides a way to skip projects that are missing a target this message will go away: Microsoft/msbuild#2471
Ticket for this issue:
https://github.com/NuGet/Home/issues/5940
If this block your restore or you seeing a failure in the log, please try to update the nuget.exe version in the build server, if this still doesn't work, you can re-open the issue 5940 with some more details info.
Hope this helps.
Upvotes: 2