msbuild - 错误 MSB4064 : The "OverwriteReadOnlyFiles" parameter is not supported by the "Copy" task

标签 msbuild msbuild-task msbuild-4.0

我正在使用 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/

相关文章:

c# - 生成后事件执行 PowerShell

MSBuild 包位置

msbuild - msbuild可以编译构建任务然后使用它们吗?

msbuild - 如何使用 MSBuild 复制任务复制到多个目标文件夹?

iis - msbuild-未经授权的AccessException : Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344

TeamCity MSBuild 4.0 帮助

MSBuild 解决项目引用错误

.net - StyleCop 与 CI 构建过程(Cruise Control、Nant、msbuild 和 StyleCop)的集成

powershell - 在MsBuild中,如何运行PowerShell,并报告所有错误

.net - 构建完成后从 IntermediateOutputPath 复制 MSBuild