Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Folder Publish (Cross Plat)

Vijay Ramakrishnan edited this page Feb 22, 2018 · 1 revision

Folder publish:

using MSBuild (without a profile)

msbuild WebApplication.csproj /p:DeployOnBuild=true /p:PublishUrl="C:\deployedApp\newapp"

using dotnet (without a profile)

dotnet publish WebApplication.csproj /p:PublishDir="C:\deployedApp\newapp"

Profile can be added to the following location in the project /Properties/PublishProfiles/<FolderProfile.pubxml>. Folder Publish profile samples are available below:

Using MSBuild (with a profile)

msbuild WebApplication.csproj /p:DeployOnBuild=true /p:PublishProfile=<FolderProfile>

Using dotnet (with a profile)

dotnet publish WebApplication.csproj /p:PublishProfile=<FolderProfile>

Sample Folder Profile:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <PublishProvider>FileSystem</PublishProvider>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <publishUrl>bin\Release\PublishOutput</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
  </PropertyGroup>  
</Project>
Clone this wiki locally