我有一个全新的Windows 10安装,安装了VS2017。
VisualStudio已关闭。致电nuget restore xxx.sln
后,我收到以下错误消息:
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.
现在,我打开VisualStudio并加载项目xxx.sln
文件,然后再次调用nuget restore
cmd,一切正常:
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
我安装了相同的VisualStudio软件包,并设置了与我们的第一个构建服务器完全相同的环境变量/路径,但是我无法使其正常工作。有人知道这种行为吗?
因此,如果尝试构建项目是完全相同的问题。错误消息以及在vs中加载项目后,一切都按预期运行!
答案 0 :(得分:2)
MSBuild失败,但是在Visual Studio中加载项目后,它可以与MSBuild一起使用
我已经向nuget团队报告了相同的问题,然后我收到了以下答复:
此消息是预期的,但它不应阻止您的还原。
将来,一旦msbuild提供了一种跳过项目的方法, 缺少目标,此消息将消失: Microsoft/msbuild#2471
此问题的门票:
https://github.com/NuGet/Home/issues/5940
如果此操作阻止您的还原,或者您在日志中看到失败,请尝试更新构建服务器中的nuget.exe版本,如果仍然无法执行此操作,则可以重新打开5940问题详细信息。
希望这会有所帮助。
答案 1 :(得分:0)
问题已解决,但我无法详细解释原因。
为解决错误消息,我用dotnet
重建了nuget文件。但是后来我无法获取git分支。.所以我走得更远,发现自己的nuget包流和git正在运行的服务器上没有磁盘空间。我清理了硬盘,可以毫无错误地构建它。
所以我认为这是错误和奇怪行为的一部分。
答案 2 :(得分:0)
添加此标志应该会有所帮助,因为nuget.exe实用程序搜索可能并不总是有效的最新msbuild。将其中一个用作VS可为您提供正确的确定性水平。
nuget restore xxx.sln -msbuildpath <your msbuild path>
示例:
nuget restore myProject.csproj -Source https://NuGet.org/api/v2/ -msbuildpath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"