-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Area: TasksIssues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.Issues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.triaged
Milestone
Description
A project with multiple items with CopyToOutputDirectory and conflicting assigned TargetPaths will cause the last file to be copied to the TargetPath.
I'm not certain this is a bug, but the behavior seems non-intuitive. It seems like multiple files trying to output to the same TargetPath should cause an error.
An example:
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="**\*.cs" Exclude="$(GlobalExclude)" />
<EmbeddedResource Include="**\*.resx" Exclude="$(GlobalExclude)" />
<Content Include="Program.cs;project.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Link>otherfilename.json</Link>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
onlyproject.json will be copied to otherfilename.json and no error is thrown.
Metadata
Metadata
Assignees
Labels
Area: TasksIssues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.Issues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.triaged