MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file docker docker

MSBUILD : error MSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file


It looks like your work dirctory contains both .csproj and .sln files. Try to specify the .sln file in the command. Run

dotnet publish your-solution-file.sln -c Release -o out

I had the same error message with dotnet build and this solves it.

By the way, since .NET Core 2.0 the dotnet restore command is run implicitly, so you may skip it.