rabejens
rabejens

Reputation: 8122

How to use "dotnet publish" with a pubxml file?

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:

What am I missing?

Upvotes: 4

Views: 3422

Answers (1)

Taul
Taul

Reputation: 2273

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.

Upvotes: 7

Related Questions