在 TravisCI 上出现以下错误 在尝试构建 ASP.NET Core WebApp 时。
Could not find project file /usr/lib/mono/xbuild/Microsoft/VisualStudio/v14.0/DotNet/Microsoft.DotNet.Props, to import. Ignoring.
基于 AppVeyor 强>。有什么方法可以安装丢失的文件吗?
请注意,我是 Travis CI 的新手,因此请提供有关如何实现您的建议的引用(例如链接/分步/指南),谢谢。
最佳答案
经过反复试验,我们得出了这个结论:
- 将这些文件放入您的存储库的根目录 https://github.com/aspnet/KoreBuild/tree/1.0.0/template
- 从 aspnet 项目复制 .travis.yml,例如https://github.com/aspnet/EntityFramework/blob/dev/.travis.yml
- 删除不需要的部分,例如分支和通知
- 确保您的解决方案和 global.json 与 build.sh 位于同一目录
我还没有找到它的任何文档,所以如果它不能满足您的要求,您可以让它安装 dotnet 并自己使用命令执行您想要的操作(例如 dotnet publish
)
旧答案:
If you don't solve the problem with xbuild, you can try using dotnet cli. The install script for RTM is here:
https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.sh
Then you use
dotnet restore
anddotnet build
(cd to directory with project.json)Change your .travis.yml to this:
language: csharp install: curl -s https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.sh
| bash script: - dotnet restore WebApp/src/WebApp/project.json - dotnet build WebApp/src/WebApp/project.json addons:
apt: packages: - gettext - libcurl4-openssl-dev - libicu-dev - libssl-dev - libunwind8 - zlib1gI'm not sure all of the apt packages are necessary. source: http://andrewlock.net/adding-travis-ci-to-a-net-core-app/
It's also possible to use KoreBuild https://github.com/aspnet/KoreBuild/tree/1.0.0/template
script: ./build.sh //Add the file to repo
关于c# - ASP.NET Core WebApp 不是基于 Travis CI 构建的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38414638/