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

MSDeploy Package Publish

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

MsDeploy Package:

Using MsBuild (with the default profile)

msbuild WebApplication.csproj /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PublishProfile=Default

Using dotnet (with the default profile)

dotnet publish WebApplication.csproj /p:WebPublishMethod=Package /p:PublishProfile=Default

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

Using MsBuild (with a profile)

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

Using dotnet (with a profile)

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

Sample MsDeploy Package Publish Profile

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>Package</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <DesktopBuildPackageLocation>c:\DeployedApp\WebDeployPackage.zip</DesktopBuildPackageLocation>
    <DeployIisAppPath>Default Web Site/WebAppWithDB</DeployIisAppPath>
  </PropertyGroup>
</Project>