0

I cannot build my ASP.NET 1 Core 3.1 application in Travis CI and after several unsuccessfull attempts I think it’s time to figure out with the community what’s the problem.

Build: https://travis-ci.org/github/stanislavstoyanov99/CinemaWorld/jobs/686546731
Build config: https://travis-ci.org/github/stanislavstoyanov99/CinemaWorld/jobs/686546731/config

Here’s my repo in GitHub: https://github.com/stanislavstoyanov99/CinemaWorld

I think the problem is that my travis's configuration file is not in the same folder with the solution file, so I put directory path in travis configuration file, but maybe I have some mistakes.

Thanks in advance!

1 Answers1

0

In your travis yml, you are missing a dependency for the dotnet version you want installed:

dotnet: 3.1.202

I think 3.1.4 is the latest, but feel free to try different versions

Edit: I mixed up the SDK version with the runtime. To build, you need the runtime version, which as of 13/05/2020 is 3.1.202

Sotiris Panopoulos
  • 1,523
  • 1
  • 13
  • 18
  • The main problem I think is that the nuget dotnet restore command is not found in linux virtual machine that uses travis. – Stanislav Stoyanov May 13 '20 at 17:24
  • yes, because in your yml you have not defined what runtime to use. you defined mono:none, but no dotnet version. Check the docs here: https://docs.travis-ci.com/user/languages/csharp/#net-core – Sotiris Panopoulos May 13 '20 at 17:26
  • Another error is shown when I added dotnet version 3.1.4. Here's the link: https://travis-ci.org/github/stanislavstoyanov99/CinemaWorld/jobs/686698288) – Stanislav Stoyanov May 13 '20 at 18:30
  • my bad, I wrote the version of the runtime, not the SDK. Could you try 3.1.202 instead? – Sotiris Panopoulos May 13 '20 at 19:10
  • Now there's another problem with the path to solution file: https://travis-ci.org/github/stanislavstoyanov99/CinemaWorld/jobs/686729437 – Stanislav Stoyanov May 13 '20 at 19:56
  • I think you need to read up a bit on the proper configuration needed. Maybe check some links like this one: https://medium.com/@pjbgf/configuring-ci-for-net-core-using-travis-ci-and-xunit-cc0f809df4fb It seems that you are selecting the wrong path, as the travis build engine is resolving paths starting from the root of your repo. With that in mind, it should be src/CinemaWorld.sln – Sotiris Panopoulos May 13 '20 at 22:11
  • I tried to make exactly the same travis file and again It says dotnet restore exited with code 1. So I tried again with another type of configuration and again the same error - "MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.". I think there's a huge problem with this system .. There's is a hope according to the restore of my libraries. Here is the new link: https://travis-ci.org/github/stanislavstoyanov99/CinemaWorld/jobs/687042530 – Stanislav Stoyanov May 14 '20 at 14:28
  • Thank you so much for the help with 16 unsuccessfull atempts this configuration has built my project successfully: https://travis-ci.org/github/stanislavstoyanov99/CinemaWorld/jobs/687045281 https://i.postimg.cc/DzKHtPm0/travis.jpg – Stanislav Stoyanov May 14 '20 at 14:36
  • yay! Glad I helped eventually. If the answer helped you, would you be so kind and mark my answer as accepted? – Sotiris Panopoulos May 14 '20 at 14:38