Petre T
Petre T

Reputation: 472

ASP.NET Core WebApp not building on Travis CI

Getting the following error on TravisCI when trying to build an ASP.NET Core WebApp.

Could not find project file /usr/lib/mono/xbuild/Microsoft/VisualStudio/v14.0/DotNet/Microsoft.DotNet.Props, to import. Ignoring.

Builds on AppVeyor. Is there any way to install the missing file?

Note that I'm new to Travis CI so please include a reference (eg. link/step by step/guide) on how to implement your suggestion, thank you.

Upvotes: 4

Views: 835

Answers (1)

J2ghz
J2ghz

Reputation: 658

After trial and error we've came up with this:

I haven't found any documentation for it, so if it doesn't do what you want, you can just let it install dotnet and do what you want with commands yourself (e.g. dotnet publish)

Old answer:

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

Upvotes: 3

Related Questions