我正在尝试对.props
.vcxproj
文件进行postbuild事件引用
PostBuildEvent
标记之间适合哪些元素?
虽然它无效但我正在寻找这样的东西:
<ItemGroup>
<PostBuildEvent>
<ProjectReference Include="default.props">
</ProjectReference>
</PostBuildEvent>
</ItemGroup>
答案 0 :(得分:0)
我认为您不能在事件中包含.props文件。在ItemGroup之外包含您想要的props文件。 For example:
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns='http://schemas.microsoft.com/developer/msbuild/2003' >
<Import Project="$(VCTargetsPath)\default.props" />
</Project>
在道具文件中,您可以定义PostBuildEvent:
<ItemGroup>
<PostBuildEvent>
<Command>copy $(ProjectDir)$(Configuration)\$(TargetFileName) $(ProjectDir)$(Configuration)\copyOfMyproject.exe</Command>
<Message>Making a copy of myproject.exe</Message>
</PostBuildEvent>
</ItemGroup>
以上示例来自How to: Use Build Events in MSBuild Projects。请注意,您可能需要在道具文件的PropertyGroup中设置PostBuildEventUseInBuild项。