c# - 在 Travis CI 上使用 Mono 5.14.0.177、msbuild 15.0、nuget 4.7.1 构建失败,但在 VirtualBox 中无法重现

标签 c# .net msbuild mono nuget

我在 Xenial 和 Trusty Ubuntu 的 Travis CI 上使用 Mono 5.14.0.177、msbuild 15.0、nuget 4.7.1 时出现构建失败,但在 VirtualBox、Ubuntu Xenial 中无法重现。

运行后:

mono tools/nuget/nuget.exe 恢复 pythonnet.sln -o 包

错误信息是:

Currently running NuGet.exe 4.1.0.
Updating NuGet.exe to 4.7.1.
Update successful.
MSBuild auto-detection: using msbuild version '15.0' from '/usr/lib/mono/msbuild/15.0/bin'.
Error parsing solution file at /home/travis/build/pythonnet/pythonnet/pythonnet.sln: Invalid Image

这是在 VirtualBox 中成功构建:

https://gist.github.com/denfromufa/23557331aba2ad548eba2fbff84f2307

Travis CI 构建失败:

https://travis-ci.org/pythonnet/pythonnet/jobs/419381040

GitHub 上有关此问题的更多详细信息:

https://github.com/pythonnet/pythonnet/pull/698

最佳答案

通过降级到 msbuild 14.0,此问题已在 pythonnet Travis CI 中暂时修复:

cmd = "{0} update -self".format(nuget)
self.debug_print("Updating NuGet: {0}".format(cmd))
subprocess.check_call(cmd, shell=use_shell)
cmd = "{0} restore pythonnet.sln  -MSBuildVersion 14 -o packages".format(nuget)

https://github.com/pythonnet/pythonnet/blob/master/setup.py#L332

关于c# - 在 Travis CI 上使用 Mono 5.14.0.177、msbuild 15.0、nuget 4.7.1 构建失败,但在 VirtualBox 中无法重现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51988395/

相关文章:

c# - 如何杀死由 cmd.exe 启动的进程

c# - 如何为特定接口(interface)类型注册DI服务?

visual-studio-2010 - VSTSDB持续集成最佳实践:将我们的集成测试SQL Server与TFS Build Agent安装在同一盒子上吗?

c# - 如何让 T4ReferencePath 工作?

c# - 如何用 C# .NET 编写程序,在 Linux/Wine/Mono 上运行它们?

c# - 显示格式字符串,整数到百分比

c# - 如果一个测试没有失败,则运行所有测试

c# - 3D WPF 中的最近邻图像采样

c# - 远程桌面连接 - C# 事件

f# - 当项目文件将 AutoGenerateBindingRedirects 设置为 true 时,为什么我必须在 XUnit 规范中使用绑定(bind)重定向