0
votes

We have a VS 2017 solution with one WCF-service project and one .net-core web-application targeting .net framework 4.5.2 and .net core 1.0 (1.0.0-preview2-003131).

By some reason I cannot get the website published through "dotnet publish"-command in visual studio team services.

The problem shows up in build step "dotnet publish", project is specified to match only the web-projects solution-file (**/InventoryIndexWeb.csproj) since I only want the web to be published in this build.

Gives the following errors:

  • MSBUILD : error MSB1008: Only one project can be specified.

  • Dotnet command failed with non-zero exit code on the following projects : d:\a\3\s\WebSites\InventoryIndex\Staging\InventoryIndexWeb\InventoryIndexWeb.csproj

See screenshot for details:

MSBUILD : error MSB1008: Only one project can be specified, Dotnet command failed with non-zero exit code on the following projects : d:\a\3\s\WebSites\InventoryIndex\Staging\InventoryIndexWeb\InventoryIndexWeb.csproj

Any suggestions how to solve this or workarounds? The plan is to push this to Octopus deploy as well when we get the publish step working.

2

2 Answers

1
votes

You cannot pass multiple projects / arguments to dotnet publish.

In your case you seem to have passed the artifacts folder as second argument. To do this, add -o before that directory:

dotnet publish your.csproj -o $(Build.ArtifactStagingDirectory)
0
votes

Changing to pass -o as parameter instead of only $(Build.ArtifactStagingDirectory) did the trick as Martin stated above, and final configuration as below.