gpt4 book ai didi

visual-studio - MSBuild 失败,但在 VisualStudio 中加载项目后,它可以与 MSBuild 一起使用

转载 作者:行者123 更新时间:2023-12-04 17:42:59 26 4
gpt4 key购买 nike

我安装了 VS2017 的全新 Windows 10 安装。

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 中加载项目后,一切正常!


  • NuGet 版本:4.6.2.5055
  • MsBuild 版本:15.9.20.62856(来自“C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin”)

最佳答案

MSBuild fails, but after loading project in VisualStudio it works with MSBuild

我已经向nuget团队报告了同样的问题,然后我收到了以下回复:

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

本期工单:

https://github.com/NuGet/Home/issues/5940

如果这会阻止您的恢复或您在日志中看到失败,请尝试更新构建服务器中的 nuget.exe 版本,如果这仍然不起作用,您可以重新打开问题 5940 并提供更多信息详细信息。

希望这对您有所帮助。

关于visual-studio - MSBuild 失败,但在 VisualStudio 中加载项目后,它可以与 MSBuild 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53616098/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com