Reputation: 8122
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 MyApp
folder does not help eitherdotnet publish
.What am I missing?
Upvotes: 4
Views: 3422
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