Last active
June 4, 2018 00:42
-
-
Save flakey-bit/65e34f1bd9dbca275e5f47d8866c3534 to your computer and use it in GitHub Desktop.
Create WebDeploy package which includes transform file (Web.Release.config) - don't apply transform. Also keeps the transform file as dependent so that the "preview-transform" functionality in Visual Studio works.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | |
<PropertyGroup> | |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |
+ <CopyAllFilesToSingleFolderForMsdeployDependsOn> | |
+ CustomCollectFiles; | |
+ $(CopyAllFilesToSingleFolderForMsdeployDependsOn); | |
+ </CopyAllFilesToSingleFolderForMsdeployDependsOn> | |
+ <TransformWebConfigEnabled>False</TransformWebConfigEnabled> | |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |
<ProductVersion> | |
</ProductVersion> | |
... | |
- <None Include="Web.Release.config"> | |
+ <Content Include="Web.Release.config"> | |
<IsTransformFile>True</IsTransformFile> | |
<DependentUpon>Web.config</DependentUpon> | |
- </None> | |
+ </Content> | |
</ItemGroup> | |
... | |
+ <Target Name="CustomCollectFiles"> | |
+ <ItemGroup> | |
+ <_CustomFiles Include="Web.Release.config" /> | |
+ <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)"> | |
+ <DestinationRelativePath>Web.Release.config</DestinationRelativePath> | |
+ </FilesForPackagingFromProject> | |
+ </ItemGroup> | |
+ </Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment