Skip to content

Targets for logging Web.config transforms

April 11, 2014
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <PreProfileTransformWebConfigDependsOn>
            PreCollectFilesForProfileTransformWebConfigs;
            $(PreProfileTransformWebConfigDependsOn)
            <!--CollectFilesForProfileTransformWebConfigs;-->
            PostCollectFilesForProfileTransformWebConfigs;
        </PreProfileTransformWebConfigDependsOn>
        <PreTransformWebConfigDependsOn>
            PreCollectWebConfigsToTransform;
            $(PreTransformWebConfigDependsOn)
            <!--CollectWebConfigsToTransform;-->
            PostCollectWebConfigsToTransform;
        </PreTransformWebConfigDependsOn>
    </PropertyGroup>
    <Target Name="PostCollectFilesForProfileTransformWebConfigs">
        <Message
            Importance="high"
            Text="%0aAfter CollectFilesForProfileTransformWebConfigs%0a==============================================="
        />
        <Message
            Condition="@(FilesForPackagingFromProject) != ''"
            Importance="high"
            Text="FilesForPackagingFromProject%0a----------------------------"
        />
        <Message
            Condition="@(FilesForPackagingFromProject) != ''"
            Importance="high"
            Text=" - '%(FilesForPackagingFromProject.Identity)'%0a"
        />
        <Message
            Condition="@(ProfileWebConfigsToTransform) != ''"
            Importance="high"
            Text="ProfileWebConfigsToTransform%0a----------------------------"
        />
        <Message
            Condition="@(ProfileWebConfigsToTransform) != ''"
            Importance="high"
            Text=" - '%(ProfileWebConfigsToTransform.Identity)'%0a   - TransformFile = '%(ProfileWebConfigsToTransform.TransformFile)'%0a   - TransformFileFolder = '%(ProfileWebConfigsToTransform.TransformFileFolder)'%0a   - TransformOriginalFolder = '%(ProfileWebConfigsToTransform.TransformOriginalFolder)'%0a   - TransformOutputFile = '%(ProfileWebConfigsToTransform.TransformOutputFile)'%0a   - TransformScope = '%(ProfileWebConfigsToTransform.TransformScope)'"
        />
    </Target>
    <Target Name="PostCollectWebConfigsToTransform">
        <Message
            Importance="high"
            Text="%0aAfter CollectWebConfigsToTransform%0a=================================="
        />
        <Message
            Condition="@(FilesForPackagingFromProject) != ''"
            Importance="high"
            Text="FilesForPackagingFromProject%0a----------------------------"
        />
        <Message
            Condition="@(FilesForPackagingFromProject) != ''"
            Importance="high"
            Text=" - '%(FilesForPackagingFromProject.Identity)'%0a"
        />
        <Message
            Condition="@(WebConfigsToTransform) != ''"
            Importance="high"
            Text="WebConfigsToTransform%0a----------------------------"
        />
        <Message
            Condition="@(WebConfigsToTransform) != ''"
            Importance="high"
            Text=" - '%(WebConfigsToTransform.Identity)'%0a   - TransformFile = '%(WebConfigsToTransform.TransformFile)'%0a   - TransformFileFolder = '%(WebConfigsToTransform.TransformFileFolder)'%0a   - TransformOriginalFolder = '%(WebConfigsToTransform.TransformOriginalFolder)'%0a   - TransformOutputFile = '%(WebConfigsToTransform.TransformOutputFile)'%0a   - TransformScope = '%(WebConfigsToTransform.TransformScope)'"
        />
    </Target>
    <Target Name="PreCollectFilesForProfileTransformWebConfigs">
        <Message
            Importance="high"
            Text="%0aBefore CollectFilesForProfileTransformWebConfigs%0a==============================================="
        />
        <Message
            Condition="@(FilesForPackagingFromProject) != ''"
            Importance="high"
            Text="FilesForPackagingFromProject%0a----------------------------"
        />
        <Message
            Condition="@(FilesForPackagingFromProject) != ''"
            Importance="high"
            Text=" - '%(FilesForPackagingFromProject.Identity)'%0a"
        />
        <Message
            Condition="@(ProfileWebConfigsToTransform) != ''"
            Importance="high"
            Text="ProfileWebConfigsToTransform%0a----------------------------"
        />
        <Message
            Condition="@(ProfileWebConfigsToTransform) != ''"
            Importance="high"
            Text=" - '%(ProfileWebConfigsToTransform.Identity)'%0a   - TransformFile = '%(ProfileWebConfigsToTransform.TransformFile)'%0a   - TransformFileFolder = '%(ProfileWebConfigsToTransform.TransformFileFolder)'%0a   - TransformOriginalFolder = '%(ProfileWebConfigsToTransform.TransformOriginalFolder)'%0a   - TransformOutputFile = '%(ProfileWebConfigsToTransform.TransformOutputFile)'%0a   - TransformScope = '%(ProfileWebConfigsToTransform.TransformScope)'"
        />
    </Target>
    <Target Name="PreCollectWebConfigsToTransform">
        <Message
            Importance="high"
            Text="%0aBefore CollectWebConfigsToTransform%0a=================================="
        />
        <Message
            Condition="@(FilesForPackagingFromProject) != ''"
            Importance="high"
            Text="FilesForPackagingFromProject%0a----------------------------"
        />
        <Message
            Condition="@(FilesForPackagingFromProject) != ''"
            Importance="high"
            Text=" - '%(FilesForPackagingFromProject.Identity)'%0a"
        />
        <Message
            Condition="@(WebConfigsToTransform) != ''"
            Importance="high"
            Text="WebConfigsToTransform%0a----------------------------"
        />
        <Message
            Condition="@(WebConfigsToTransform) != ''"
            Importance="high"
            Text=" - '%(WebConfigsToTransform.Identity)'%0a   - TransformFile = '%(WebConfigsToTransform.TransformFile)'%0a   - TransformFileFolder = '%(WebConfigsToTransform.TransformFileFolder)'%0a   - TransformOriginalFolder = '%(WebConfigsToTransform.TransformOriginalFolder)'%0a   - TransformOutputFile = '%(WebConfigsToTransform.TransformOutputFile)'%0a   - TransformScope = '%(WebConfigsToTransform.TransformScope)'"
        />
    </Target>
</Project>
Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: