To run four times, you should write four items rather than two items.
In your side, DeploymentTarget A2
will be overwritten with A1
because they are under the same item.
To solve it, you have to separate them which is more like a CSProj running with the DeploymentTarget one at a time. And when you build your project with msbuild command line, each command should work with one Configuration and Platform.
Use this:
<ItemGroup>
<ProjectsForDeployment Include="/src/A/A.csproj" >
<DeploymentTarget>A1</DeploymentTarget>
<OtherMetadataWeNeed>Metadata</OtherMetadataWeNeed>
</ProjectsForDeployment>
<ProjectsForDeployment Include="/src/A/A.csproj" >
<DeploymentTarget>A2</DeploymentTarget>
<OtherMetadataWeNeed>Metadata</OtherMetadataWeNeed>
</ProjectsForDeployment>
<ProjectsForDeployment Include="/src/B/B.csproj" >
<DeploymentTarget>B1</DeploymentTarget>
<OtherMetadataWeNeed>Metadata</OtherMetadataWeNeed>
</ProjectsForDeployment>
<ProjectsForDeployment Include="/src/B/B.csproj" >
<DeploymentTarget>B2</DeploymentTarget>
<OtherMetadataWeNeed>Metadata</OtherMetadataWeNeed>
</ProjectsForDeployment>
</ItemGroup>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…