Januschan

CustomPublishWeb.targets

Aug 28th, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.81 KB | None | 0 0
  1. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  2. <!--
  3.     https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-task-reference
  4.  
  5.     ******************************************************************************
  6.     **                 CustomWebPublish Build Properties
  7.     ******************************************************************************
  8. -->
  9.     <PropertyGroup>
  10.         <BuildDependsOn>
  11.           $(BuildDependsOn);
  12.           CustomWebPublish;
  13.         </BuildDependsOn>
  14.     </PropertyGroup>
  15.  
  16.     <Target Name="CustomWebPublish">
  17.         <Message Text="Publishing Web Application '$(AssemblyName)'..." Importance="high" />
  18.  
  19.         <CreateItem Include="$(OutputPath)*">
  20.             <Output TaskParameter="Include" ItemName="Binaries"/>
  21.         </CreateItem>
  22.  
  23.         <Copy SourceFiles="@(Binaries)" DestinationFolder="$(OutputPath)Publish\bin" />
  24.  
  25.             <Copy SourceFiles="@(Content)" DestinationFolder="$(OutputPath)Publish\%(Content.RelativeDir)" />
  26.  
  27.         <Copy SourceFiles="Global.asax.cs" DestinationFolder="$(OutputPath)Publish" Condition="Exists('Global.asax.cs')"/>
  28.  
  29.         <TransformXml Source="Web.config" Transform="$(ProjectConfigTransformFileName)" Destination="$(OutputPath)Publish\%(Content.RelativeDir)Web.config" />
  30.  
  31.             <CreateItem Include="$(OutputPath)x64\*;$(OutputPath)x86\*" Condition="Exists('$(OutputPath)x64') Or Exists('$(OutputPath)x86')">
  32.             <Output TaskParameter="Include" ItemName="NativeBinaries"/>
  33.         </CreateItem>
  34.  
  35.         <Copy SourceFiles="@(NativeBinaries)" DestinationFolder="$(OutputPath)Publish\%(NativeBinaries.RelativeDir)" Condition="Exists('$(OutputPath)x64') Or Exists('$(OutputPath)x86')"/>
  36.  
  37.             <Message Text="Successfully published Web Application '$(AssemblyName)' to '$(OutputPath)Publish'" Importance="high" />
  38.    </Target>
  39. </Project>
  40.  
Add Comment
Please, Sign In to add comment