3
我看到this S.O的问题,并有类似的要求。这是我在.targets文件中有 -MSBuild多输出路径
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="$(TeamBuildOutDir) != '' ">
<OutputPath>$(TeamBuildOutDir)\Assemblies</OutputPath>
</PropertyGroup>
如何输出到多个文件夹? e.g.- $(TeamBuildOutDir)\ Assemblies2
TIA
感谢尼克,复制/粘贴弄脏它。这是我试过 -
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="$(TeamBuildOutDir) != '' ">
<OutputPath>$(TeamBuildOutDir)\Assemblies</OutputPath>
</PropertyGroup>
<Target Name="AfterBuild">
<Copy SourceFiles="$(OutputPath)\**\*.*" DestinationFolder="$(TeamBuildOutDir)\Assemblies2" />
</Target>
</Project>
我也尝试 -
<Copy SourceFiles="$(OutputPath)\***\*.*" DestinationFolder="$(TeamBuildOutDir)\Assemblies2" />
和 -
<Copy SourceFiles="$(OutputPath)\***\*.*" DestinationFolder="$(TeamBuildOutDir)\" />
的情况下,不存在造成的问题,但仍然没有运气的目录。
已更新7/28。试过,但依然不工作(没有错误,但该文件不存在输出目录它们存在于大会文件夹,所以我知道该目标文件被触发。) -
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="$(TeamBuildOutDir) != '' ">
<OutputPath>$(TeamBuildOutDir)\Assemblies</OutputPath>
</PropertyGroup>
<Target Name="AfterBuild">
<CreateItem Include="$(OutputPath)\**\*.*">
<Output ItemName="Outfiles" TaskParameter="Include" />
</CreateItem>
<Copy SourceFiles="@(Outfiles)" DestinationFiles="@(Outfiles->'$(TeamBuildOutDir)\%(relativedir)%(Filename)%(Extension)')" SkipUnchangedFiles="false" />
</Target>
</Project>
感谢尼克!我会试着去报告。 – Pete
我试过这个,但它没有工作 - $(TeamBuildOutDir)\装配 的PropertyGroup> <目标名称= “AfterBuild”> <复制SourceFiles = “$(OutputPath)\ ** \ *。*” DestinationFolder =“$(TeamBuildOutDir)\ Assemblies2 “/> –
Pete
请注意您的SourceFiles位置是如何”**“。何时应该是“** \ *。*”。 – Nicodemeus