我尝试通过TeamCity建立一个网站。这是一个三个阶段的过程。前两个还原NuGet软件包,第三个还原网站。
这也是第3步的构建步骤。
第一个警告只通过了
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修复了该问题,并更新了从版本到版本5的NuGet.exe。我尝试再次运行它,现在遇到一个奇怪的错误。
[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\ "
中有一个空格
那怎么走?
答案 0 :(得分:1)
This issue should have been solved in March。令您惊讶的是,我感到很惊讶,因为这意味着您在2018年12月20日至2019年3月5日之间创建了解决方案(使用VS2010、2012或2013),但只是更新为更新的{{1 }}。无论如何,如果您想继续使用这种过时的,过时的NuGet还原方式,则需要像我在GitHub问题中所写的那样手动编辑nuget.exe
文件。
但是,我仍然推荐migrating to automatic package restore。这意味着您需要在CI管道中进行额外的步骤来进行还原,然后再进行构建,但是Visual Studio 2015及更高版本不再具有以解决方案的方式添加NuGet还原的功能。