3

I have a .net Core application and some pubxml files. When I publish from Visual Studio, it works. But I cannot figure out how to publish from the command line.

This question does not help:

  • dotnet publish -c Release MyApp /p:PublishProfile=MyApp\Properties\PublishProfiles\Win64.pubxml publishes a portable version
  • Going into the MyApp folder does not help either
  • The linked question has a link to a Github issue but this is about msbuild, I want to use dotnet publish.

What am I missing?

rabejens
  • 7,594
  • 11
  • 56
  • 104

1 Answers1

4

There is a newer answer on that other question that solves your question.

The short version is that you need to supply the path to the project and the path to the the pubxml file as arguments for dotnet publish.

dotnet publish .\pathToYourProject\projectFile.csproj --configuration Release /p:PublishProfile=.\pathToYourPubXmlFolder\PubProfile.pubxml

As noted there, this should work on Windows but doesn't on Linux.

Taul
  • 2,113
  • 1
  • 14
  • 18