MSBuild、CreateItem 到 ItemGroup 将目标 binplace 到多个文件夹
简短的故事:我有一个名为 true 的属性的列表。我想将所有这些文件复制到文件夹列表中,例如由...
someFolder
定义的为此目的,这就是我今天要做的事情:
<CreateItem Include="%(Reference.HintPath)"
Condition="'%(Reference.Binplace)' == 'true'"
AdditionalMetadata="DestinationFolder=$(DestinationForReferences)\%(Reference.BinplaceFolder)">
<Output ItemName="Binplace" TaskParameter="Include" />
</CreateItem>
我已经有一个名为 Binplace 的目标,它在内部调用 Copy。问题是这是一个单一元素,我不知道如何对其中多个项目调用 Copy
在我的 CSPROJ 文件中,我这样做:
<Reference Include="MyCompany.Something.Something">
<HintPath>$(LocalLibraryFolder)\MyCompany.Something.Something.dll</HintPath>
<Binplace>true</Binplace>
</Reference>
Short-story: I have a list of with an attribute called true. I want to copy all of these files, to a list of folders, say defined by ...
someFolder
To that end, here's what I'm doing today:
<CreateItem Include="%(Reference.HintPath)"
Condition="'%(Reference.Binplace)' == 'true'"
AdditionalMetadata="DestinationFolder=$(DestinationForReferences)\%(Reference.BinplaceFolder)">
<Output ItemName="Binplace" TaskParameter="Include" />
</CreateItem>
I already have a target called Binplace which internally calls Copy. The problem is that is a single element, and I don't know how I can call Copy on multiple of these items
And in my CSPROJ file, I do this:
<Reference Include="MyCompany.Something.Something">
<HintPath>$(LocalLibraryFolder)\MyCompany.Something.Something.dll</HintPath>
<Binplace>true</Binplace>
</Reference>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)