Skip to content

Instantly share code, notes, and snippets.

@devops-school
Created September 21, 2019 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devops-school/6456a092b76ebf6f4f3980fd140aa109 to your computer and use it in GitHub Desktop.
Save devops-school/6456a092b76ebf6f4f3980fd140aa109 to your computer and use it in GitHub Desktop.
- Import WebApplication.targets in your build script like so:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
- Execute the TransformXml build task in your build script target:
<Target Name="MyBuildScriptTarget">
<TransformXml Source="Web.config" Transform="Web.$(Configuration).config" Destination="Web.config" />
...other build tasks...
</Target>
- Command
MSBuild.exe PATH_TO_PROJ.csproj /p:DeployOnBuild=true /p:PublishProfile=PUBLISH_TARGET /p:Configuration=Release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment