Skip to content

MSBuild mangles whitespace in attribute strings when preprocessing #362

Open
@rainersigwald

Description

@rainersigwald

The MSBuild preprocessor makes its output harder to read by collapsing whitespace inside strings (probably due to XML parsing or output). It'd be nice if it kept things as

    <Target
        Name="XamlPreCompile"
        Inputs="$(MSBuildAllProjects);
                @(Compile);
                @(_CoreCompileResourceInputs);
                $(ApplicationIcon);
                $(AssemblyOriginatorKeyFile);
                @(ReferencePath);
                @(CompiledLicenseFile);
                @(LinkResource);
                @(EmbeddedDocumentation);
                $(Win32Resource);
                $(Win32Manifest);
                @(Page);
                @(ApplicationDefinition);
                @(CustomAdditionalCompileInputs);
                $(ResolvedCodeAnalysisRuleSet)"
        Outputs="@(DocFileItem);
                 @(XamlIntermediateAssembly);
                 @(_DebugSymbolsIntermediatePath);
                 $(NonExistentFile);
                 @(CustomAdditionalCompileOutputs)"
        Returns=""
        DependsOnTargets="$(CoreCompileDependsOn)"
        Condition="'@(Page)' != '' Or '@(ApplicationDefinition)' != ''"
    >

instead of turning it into

  <Target Name="XamlPreCompile" Inputs="$(MSBuildAllProjects);&#xD;&#xA;                @(Compile);&#xD;&#xA;                @(_CoreCompileResourceInputs);&#xD;&#xA;                $(ApplicationIcon);&#xD;&#xA;                $(AssemblyOriginatorKeyFile);&#xD;&#xA;                @(ReferencePath);&#xD;&#xA;                @(CompiledLicenseFile);&#xD;&#xA;                @(LinkResource);&#xD;&#xA;                @(EmbeddedDocumentation);&#xD;&#xA;                $(Win32Resource);&#xD;&#xA;                $(Win32Manifest);&#xD;&#xA;                @(Page);&#xD;&#xA;                @(ApplicationDefinition);&#xD;&#xA;                @(CustomAdditionalCompileInputs);&#xD;&#xA;                $(ResolvedCodeAnalysisRuleSet)" Outputs="@(DocFileItem);&#xD;&#xA;                 @(XamlIntermediateAssembly);&#xD;&#xA;                 @(_DebugSymbolsIntermediatePath);&#xD;&#xA;                 $(NonExistentFile);&#xD;&#xA;                 @(CustomAdditionalCompileOutputs)" Returns="" DependsOnTargets="$(CoreCompileDependsOn)" Condition="'@(Page)' != '' Or '@(ApplicationDefinition)' != ''">

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions