【发布时间】:2019-03-31 14:44:43
【问题描述】:
我有多个解决方案,可以通过 NuGet 源(由 TeamCity 驱动,2018.1.3(内部版本 58658))相互共享包。解决方案A 向 NuGet 提要公开了几个项目,来自解决方案 B 的项目引用了其中一些包。 SolutionB 中的一些项目也应该打包并发布到 NuGet 源。
对于解决方案,打包和发布非常完美。对于解决方案B,依赖于从解决方案A 发布到 NuGet 的包的项目打包因奇怪的问题而失败。当 TeamCity 执行 NuGet 包还原步骤时,包被下载到 packages\Project.From.SolutionA.3.181.181\ 文件夹。然后构建步骤成功完成,但打包步骤失败,因为 NuGet pack 命令在文件夹 packages\Project.From.SolutionA\3.181.181\ 中查找包!
以下是 pack 命令的构建日志(NuGet 版本为 4.8.1)
Missing <TeamCityDir>\buildAgent\work\fbb25b8e9614747\packages\Project.From.SolutionA\3.181.181\Project.From.SolutionA.3.181.181.nupkg
Error NU5012: Unable to find 'Project.From.SolutionA.3.181.181.nupkg'. Make sure the project has been built.
NuGet.Packaging.Core.PackagingException: Unable to find 'Project.From.SolutionA.3.181.181.nupkg'. Make sure the project has been built.
at NuGet.CommandLine.ProjectFactory.AddDependencies(Dictionary`2 packagesAndDependencies)
at NuGet.CommandLine.ProjectFactory.ProcessDependencies(PackageBuilder builder)
at NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath, NuGetVersion version, String suffix, Boolean buildIfNeeded, PackageBuilder builder)
at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
at NuGet.Commands.PackCommandRunner.BuildPackage()
at NuGet.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
唯一被替换的是项目的真实路径和名称
【问题讨论】:
标签: nuget teamcity nuget-package