我正在尝试在 TFS 中为 WPF 项目实现自动构建。
自动构建效果很好,但我无法为该项目准备 nuget 包。
这是我在 TFS 中的构建过程:
如果我删除 NuGet 包和 NuGet 推送,它就可以正常工作。
以下是我通过 TFS 收到的消息:
Found packages.config. Using packages listed as dependencies
NuGet.CommandLine.CommandLineException: Unable to find 'Extended.Wpf.Toolkit.3.3.0.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.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
Unable to find 'Extended.Wpf.Toolkit.3.3.0.nupkg'. Make sure the project has been built.
##[error]The nuget command failed with exit code(1) and error(Unable to find 'Extended.Wpf.Toolkit.3.3.0.nupkg'. Make sure the project has been built.)
在日志中,它表示找不到“Extended.Wpf.Toolkit.3.3.0.nupkg”。我在构建之前使用了 NuGet Restore,并且构建是正确的。在TFS的日志中,我可以看到它使用“Extended.Wpf.Toolkit.3.3.0”
我已经尝试添加-Prop Platform=AnyCPU
NuGet 用于打包的命令,但它没有改变任何内容。我在我的计算机上运行了该命令并且它起作用了。
以下是我在搜索修复程序时已经检查过的页面:
- https://developercommunity.visualstudio.com/content/problem/245349/the-nuget-command-failed-with-exit-code1-and-error.html https://developercommunity.visualstudio.com/content/problem/245349/the-nuget-command-failed-with-exit-code1-and-error.html
- 用于 TFS 持续集成的 NuGet 包 https://stackoverflow.com/questions/20681547/nuget-pack-for-tfs-continuous-integration
- NuGet 包失败并显示“无法找到 '@(_OutputPathItem->'%(FullPath)...” https://stackoverflow.com/questions/21583070/nuget-pack-fails-with-unable-to-find-outputpathitem-fullpath
- VisualStudio Online 和打包 Nuget 包 https://stackoverflow.com/questions/50715419/visualstudio-online-and-pack-nuget-packages
- http://timjames.me/blog/2015/07/29/nuget-pack-fails-with-exited-with-code-1/ http://timjames.me/blog/2015/07/29/nuget-pack-fails-with-exited-with-code-1/
- https://www.benday.com/2017/05/03/walkthrough-publish-to-private-nuget-server-from-tfs2017-build/ https://www.benday.com/2017/05/03/walkthrough-publish-to-private-nuget-server-from-tfs2017-build/
打包时可能缺少配置,选择.csproj
file.
如果您选择了$(BuildConfiguration)
身为你的配置到包 option.
您还必须指定 BuildConfiguration 的值
看看使用上的区别**\*.csproj
and **\*.nuspec
指定 .csproj 文件(例如,**\*.csproj
)对于简单的
项目。在这种情况下:
- 打包器编译 .csproj 文件以进行打包。
- 您必须指定包的配置(见下文)。
- 您不必签入 .nuspec 文件。如果您确实签入其中一项,打包程序将遵循其设置并替换诸如 $id$ 和
$描述$。
指定 .nuspec 文件(例如,**\*.nuspec
)对于更复杂的
项目,例如您需要的多平台场景
分步进行编译和打包。在这种情况下:
- 打包程序不会编译用于打包的 .csproj 文件。
- 仅当每个项目签入了 .nuspec 文件时才会打包。
- 打包程序不会替换 .nuspec 文件中的标记(元素除外,请参阅使用内部版本号对包进行版本控制,
以下)。您必须为以下元素提供值
<id/>
and
<description/>
。最常见的方法是硬编码
中的值.nuspec
file.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)