作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试通过 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}"
[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.
[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/
我是一名优秀的程序员,十分优秀!