Januschan icon

CustomPublishWeb.targets

Januschan | PRO | 08/28/20 04:42:31 PM UTC | 0 ⭐ | 321 👁️ | Never ⏰ | []
XML |

1.81 KB

|

None

|

0 👍

/

0 👎

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
    https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-task-reference
 
    ******************************************************************************
    **                 CustomWebPublish Build Properties
    ******************************************************************************
-->
    <PropertyGroup>
        <BuildDependsOn>
          $(BuildDependsOn);
          CustomWebPublish;
        </BuildDependsOn>
    </PropertyGroup>
 
    <Target Name="CustomWebPublish">
        <Message Text="Publishing Web Application '$(AssemblyName)'..." Importance="high" />
 
        <CreateItem Include="$(OutputPath)*">
            <Output TaskParameter="Include" ItemName="Binaries"/>
        </CreateItem>
 
        <Copy SourceFiles="@(Binaries)" DestinationFolder="$(OutputPath)Publish\bin" />
 
            <Copy SourceFiles="@(Content)" DestinationFolder="$(OutputPath)Publish\%(Content.RelativeDir)" />
 
        <Copy SourceFiles="Global.asax.cs" DestinationFolder="$(OutputPath)Publish" Condition="Exists('Global.asax.cs')"/>
 
        <TransformXml Source="Web.config" Transform="$(ProjectConfigTransformFileName)" Destination="$(OutputPath)Publish\%(Content.RelativeDir)Web.config" />
 
            <CreateItem Include="$(OutputPath)x64\*;$(OutputPath)x86\*" Condition="Exists('$(OutputPath)x64') Or Exists('$(OutputPath)x86')">
            <Output TaskParameter="Include" ItemName="NativeBinaries"/>
        </CreateItem>
 
        <Copy SourceFiles="@(NativeBinaries)" DestinationFolder="$(OutputPath)Publish\%(NativeBinaries.RelativeDir)" Condition="Exists('$(OutputPath)x64') Or Exists('$(OutputPath)x86')"/>
 
            <Message Text="Successfully published Web Application '$(AssemblyName)' to '$(OutputPath)Publish'" Importance="high" />
   </Target>
</Project>
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎