Skip to content

PostBuildEvent not migrated correctly #285

@RichardD2

Description

@RichardD2

Source project extract:

<PropertyGroup>
    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)..\_bin\$(ConfigurationName)\" /y /c
xcopy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)..\_bin\$(ConfigurationName)\" /y /c
xcopy "$(TargetDir)$(TargetName).xml" "$(SolutionDir)..\_bin\$(ConfigurationName)\" /y /c</PostBuildEvent>
</PropertyGroup>

Expected result:

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <Exec Command="xcopy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)..\_bin\$(ConfigurationName)\&quot; /y /c&#xD;&#xA;xcopy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)..\_bin\$(ConfigurationName)\&quot; /y /c&#xD;&#xA;xcopy &quot;$(TargetDir)$(TargetName).xml&quot; &quot;$(SolutionDir)..\_bin\$(ConfigurationName)\&quot; /y /c" />
</Target>

Actual result:

<PropertyGroup>
    <OutputType>...</OutputType>
    ...
    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)..\_bin\$(ConfigurationName)\" /y /c
xcopy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)..\_bin\$(ConfigurationName)\" /y /c
xcopy "$(TargetDir)$(TargetName).xml" "$(SolutionDir)..\_bin\$(ConfigurationName)\" /y /c</PostBuildEvent>
</PropertyGroup>
...
<PropertyGroup>
    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)..\_bin\$(ConfigurationName)\" /y /c
xcopy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)..\_bin\$(ConfigurationName)\" /y /c
xcopy "$(TargetDir)$(TargetName).xml" "$(SolutionDir)..\_bin\$(ConfigurationName)\" /y /c</PostBuildEvent>
</PropertyGroup>

The command is inserted into the output project twice, and is not converted to the new syntax. VS2019 does not support the old syntax.

Using the latest version (4.1.3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions