2

I'm playing with CI and trying to build asp.net core app and publish it to azure using preconfigured publishing profile. I can run the following command using a command line but when I'm running it with Jenkins (Windows) it fails:

dotnet build -c Release /p:DeployOnBuild=true /p:PublishProfile=mycoolprofile

And I'm getting the following output with error:

Microsoft (R) Build Engine version
15.6.84.34536 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1008: Only one project can be specified. Switch: p:PublishProfile=mycoolprofile

And of course, I saw all quotes discussions, I renamed my profile to be a simple single word, this is the real profile name above.

I'm following this guide: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/visual-studio-publish-profiles

Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
Mando
  • 11,414
  • 17
  • 86
  • 167

1 Answers1

7

Just 'solved' this problem by adding an extra slash. It seems that dotnet swallows it

dotnet build //t:MyTarget MyProject.csproj
xtofl
  • 40,723
  • 12
  • 105
  • 192
  • 1
    Make sure if the target / output directories have spaces in them that you quote it ie "C:\frank\and beans\are\for\dinner\". – aCodeMonkey Oct 29 '21 at 01:45