我正在使用 Msbuild 4.0。当我使用 Msbuild 3.5 OverwriteReadonlyfiles 时,没有任何问题。
但是今天当我尝试使用复制任务时,我遇到了这个问题。
错误 MSB4064:
The "OverwriteReadOnlyFiles" parameter is not supported by the "Copy" t ask. Verify the parameter exists on the task, and it is a settable public instance property.
这是我的目标,它有复制任务
<Target Name="CopyBOM">
<Copy SourceFiles="@(BOM)" DestinationFolder="%(BOM.Destination)" OverwriteReadOnlyFiles="true">
<Output TaskParameter="CopiedFiles" ItemName="CopyBOMFiles" />
</Copy>
<Message Text="Copied to BOM: @(CopyBOMFiles)"/>
</Target>
以下是我在我的属性文件中使用的项目组
<BOM Include="..\..\..\Release\CoreDeployment.msi">
<Destination>..\..\..\Core\BOM\Comp1</Destination>
</BOM>
我有多个属性文件,我已经验证在所有地方都放置了 Toolsversion=4.0。
有没有人遇到过这种情况?有什么办法可以解决这个问题吗?
最佳答案
我正在使用 OverwriteReadOnlyFiles="true"没有问题。尝试将 ToolsVersion="4.0"添加到您的项目标签中:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
关于msbuild - 错误 MSB4064 : The "OverwriteReadOnlyFiles" parameter is not supported by the "Copy" task,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8909649/