I want to know if their is any tag to set the output path of the dotnet publish
within the .csproj-file.
I know I can use something along the lines of publish "someproject.csproj" --output "..\mypubfolder"
from the command line. But I want to specify a (default) publish folder within the .csproj-file
To publish from Visual Studio, do the following: Change the solution configuration from Debug to Release on the toolbar to build a Release (rather than a Debug) version of your app. Right-click on the project (not the solution) in Solution Explorer and select Publish. In the Publish tab, select Publish.
Right-click on the project node in Solution Explorer and select Properties. Expand the Build section, and select the Output subsection. Find the Base output path for C#, and type in the path to generate output to (absolute or relative to the root project directory), or choose Browse to browse to that folder instead.
To make publish output go to separate folders for each project, specify a relative path by using the msbuild PublishDir property instead of the --output option. For example, dotnet publish -p:PublishDir=. \publish sends publish output for each project to a publish folder under the folder that contains the project file.
You can set the PublishDir
property which is used for the Publish
target:
<PropertyGroup>
<PublishDir>..\mypubfolder</PublishDir>
</PropertyGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With