gpt4 book ai didi

msbuild - Nuget.targets : error could not find a part of the path

转载 作者:行者123 更新时间:2023-12-01 03:05:03 26 4
gpt4 key购买 nike

我尝试通过 TeamCity 构建网站。这是一个三个阶段的过程。前两个还原 NuGet 包,第三个构建网站。

enter image description here

这也是第 3 步的构建步骤。

enter image description here

第一个通过这个唯一的警告

Step 1/3: Restore the NuGet Packages for BalanceToBuy (NuGet Installer) (3s)
[10:22:43][Step 1/3] scan: Searching for nuget.config files
[10:22:43][scan] RepositoryPath was not extracted from NuGet.config file at C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.Config. Packages will be downloaded into default path: C:\TeamCity\buildAgent\work\a606a53a0957ca4b\packages.
[10:22:43][scan] Found packages folder: C:\TeamCity\buildAgent\work\a606a53a0957ca4b\packages
[10:22:43][scan] No repositories.config found at C:\TeamCity\buildAgent\work\a606a53a0957ca4b\packages\repositories.config
[10:22:43][scan] Failed to resolve project reference from solution file: Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://localhost:66", "http://localhost:66", "{72D2746B-946D-4670-AB52-C087971DB810}"

第二个通过了这些消息的第一个错误(其中 22 个)
[10:22:51][Buy.Business\Buy.Business.csproj] RestorePackages
[10:22:51][RestorePackages] Exec
[10:22:51][Exec] "C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.exe" install "C:\TeamCity\buildAgent\work\a606a53a0957ca4b\Buy.Business\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "C:\TeamCity\buildAgent\work\a606a53a0957ca4b\ "
[10:22:52][Exec] Restoring NuGet packages...
[10:22:52][Exec] To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
[10:22:52][Exec] EXEC 'Dapper' already has a dependency defined for 'System.Data.SqlClient'.
[10:22:52][Exec] Installing 'log4net 2.0.8'.
[10:22:52][Exec] Installing 'Dapper 1.60.6'.
[10:22:52][Exec] Successfully installed 'log4net 2.0.8'.
[10:22:52][Exec] C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.targets(100, 9): 'Dapper' already has a dependency defined for 'System.Data.SqlClient'.
[10:22:52][Exec] C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.targets(100, 9): The 'Newtonsoft.Json 12.0.2' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.8.60717.93'.
[10:22:52][Exec] C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.targets(100, 9): error MSB3073: The command ""C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.exe" install "C:\TeamCity\buildAgent\work\a606a53a0957ca4b\BalanceToBuy.Business\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "C:\TeamCity\buildAgent\work\a606a53a0957ca4b\ "" exited with code 1.

我通过手动转到 CLI 解决了这个问题,并更新了 NuGet.exe,它从版本到版本 5。我再次尝试运行它,现在出现一个奇怪的错误。
[11:46:44][Exec] C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.targets(100, 9): Could not find a part of the path 'C:\TeamCity\buildAgent\work\a606a53a0957ca4b\ \packages\EnterpriseLibrary.Common.6.0.1304.0'.
[11:46:44][Exec] C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.targets(100, 9): Could not find a part of the path 'C:\TeamCity\buildAgent\work\a606a53a0957ca4b\ \packages\FastMember.Signed.1.3.0'.
[11:46:44][Exec] C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.targets(100, 9): Could not find a part of the path 'C:\TeamCity\buildAgent\work\a606a53a0957ca4b\ \packages\EntityFramework.6.2.0'.
[11:46:44][Exec] C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.targets(100, 9): error MSB3073: The command ""C:\TeamCity\buildAgent\work\a606a53a0957ca4b\.nuget\NuGet.exe" install "C:\TeamCity\buildAgent\work\a606a53a0957ca4b\BalanceToBuy.Utility\packages.config" -source "" -NonInteractive -RequireConsent -solutionDir "C:\TeamCity\buildAgent\work\a606a53a0957ca4b\ "" exited with code 1.

我注意到 -solutionDir "C:\TeamCity\buildAgent\work\a606a53a0957ca4b\ " 中有一个空格
这是怎么到那里的?

最佳答案

This issue should have been solved in March .我很惊讶您现在会得到它,因为这意味着您在 2018 年 12 月 20 日和 2019 年 3 月 5 日之间创建了您的解决方案(使用 VS2010、2012 或 2013),但只是更新到更新的 nuget.exe现在。无论如何,如果您想继续使用这种过时的 NuGet 还原方式,您需要手动编辑您的 nuget.targets我在 GitHub 问题中写的文件。

不过我还是推荐migrating to automatic package restore .这意味着在构建之前,您需要在 CI 管道中执行一个额外的步骤来执行还原,但 Visual Studio 2015 以后不再具有以您的解决方案执行的方式添加 NuGet 还原的功能。

关于msbuild - Nuget.targets : error could not find a part of the path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58715998/

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