Dotnet restore failed on .net core 3.1

I have a microservices based application with one solution but it has several projects - 5 exactly.
I have some test that I’d like to build in Travis CI, however I’m getting The command "dotnet restore" failed and exited with 1 during
This is my very first time working with Travis.

My .travis.yml file:

language: csharp
mono: none
dotnet: 3.1.202
sudo: required

before_install:
  -sudo apt-get install nuget
install:
  -dotnet restore
branches:
    only:
     -Testing

script:
 -dotnet build
 -dotnet test TestCore/TestCore.csproj"

The log on travis:

Installing .NET Core

0.00s

git.checkout

0.71s$ git clone --depth=50 --branch=Testing https://github.com/NagyDominik/OnlineRetailer_Partial.git NagyDominik/OnlineRetailer_Partial

0.01s

0.11s$ dotnet --info

.NET Core SDK (reflecting any global.json):

 Version:   3.1.202

 Commit:    6ea70c8dca

Runtime Environment:

 OS Name:     ubuntu

 OS Version:  16.04

 OS Platform: Linux

 RID:         ubuntu.16.04-x64

 Base Path:   /usr/share/dotnet/sdk/3.1.202/

Host (useful for support):

  Version: 3.1.4

  Commit:  0090613580

.NET Core SDKs installed:

  3.1.202 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:

  Microsoft.AspNetCore.App 3.1.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]

  Microsoft.NETCore.App 3.1.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:

  https://aka.ms/dotnet-download

before_install

17.04s$ sudo apt-get install nuget

**$ dotnet restore**

Welcome to .NET Core 3.1!

---------------------

SDK Version: 3.1.202

----------------

Explore documentation: https://aka.ms/dotnet-docs

Report issues and find source on GitHub: https://github.com/dotnet/core

Find out what's new: https://aka.ms/dotnet-whats-new

Learn about the installed HTTPS developer cert: https://aka.ms/aspnet-core-https

Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs

Write your first app: https://aka.ms/first-net-core-app

--------------------------------------------------------------------------------------

More than one project or solution file.

The command "dotnet restore" failed and exited with 1 during .

Your build has been stopped.

Any suggestion is very welcomed!
@akoeplinger @nterry

hi bencematyasi,

I stumbled on your question, and I think I’m able to help. The error message from the dotnet restore is the line More than one project or solution file. from the log you provided.

You should be able to reproduce this on your local environment by calling dotnet restore from the repo root. The solution is to either explicitly specify the sln/proj file in the dotnet restore call of your .travis.yml (dotnet restore <path-to-sln/proj>) or change the structure of the repo (dotnet restore won’t fail, at least with this error in a folder that only contains exactly one sln/proj file).