Skip to content

Instantly share code, notes, and snippets.

@mxrss
Created October 29, 2013 21:36
Show Gist options
  • Save mxrss/7223076 to your computer and use it in GitHub Desktop.
Save mxrss/7223076 to your computer and use it in GitHub Desktop.
msbuild and msdeploy script
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition="$(Configuration) == '' "></Configuration>
<MsDeployPath>C:\Program Files\IIS\Microsoft Web Deploy V3</MsDeployPath>
<DeployPackageLocation>SomePath</DeployPackageLocation>
<UserName>notauser</UserName>
<Password>NotAPassword</Password>
<MachineName>noteahost</MachineName>
<PackageLocation>SomePackage.Zip</PackageLocation>
</PropertyGroup>
<Target Name="Publish2" DependsOnTargets="Build" AfterTargets="Build" Condition="$(Configuration) == 'Release'" >
<MSBuild Projects ="$(MSBuildProjectFullPath)"
Targets="Package"
Properties="
DeployOnBuild=true;
Configuration=$(Configuration);
MSDeployTarget='MsDeployPublish';
MSDeployPublishMethod='RemoteAgent';
MsDeployServiceUrl='someurl';
allowUntrusted=true"
/>
<Exec WorkingDirectory="$(MsDeployPath)" Command="msdeploy.exe -verb:sync -source:package=&quot;$(MSBuildProjectDirectory)\obj\Release\Package\${PackageLocation}&quot; -dest:auto,computerName=$(MachineName),userName=$(UserName),password=$(Password) -setParam:kind=ProviderPath,scope=iisApp,value=&quot;Default Web Site\&quot; -skip:Directory=//Logs"/>
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment