c# - ASP.NET Core WebApp 不是基于 Travis CI 构建的

标签 c# asp.net-core travis-ci

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 的新手,因此请提供有关如何实现您的建议的引用(例如链接/分步/指南),谢谢。

最佳答案

经过反复试验,我们得出了这个结论:

我还没有找到它的任何文档,所以如果它不能满足您的要求,您可以让它安装 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 and dotnet 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 - zlib1g

I'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/

相关文章:

haskell - travis-ci 什么时候支持 ghc 7.10?

c# - 如何让 System.Web.HttpWebRequest 对象使用 SSL 2.0?

c# - ASP.NET 网站页面未反射(reflect)最近的更改

azure - Docker 和 AzureKeyVault : unable to load shared library 'libsecret-1.so.0'

asp.net - 使用 Identity Core 在 ASP.Net Core 2.1 中登录后立即添加重定向

python - 为什么 python setup.py 在 Travis CI 上说无效命令 'bdist_wheel'?

c# - Aes-Gcm/Aes-Cbc - 数据库存储 - 列设计

c# - 如何将复杂类作为参数传递给 httpget

c# - 从外部程序集加载 TagHelper

python - 如何将 Travis CI 与 gitignore 中的某些文件一起使用?