Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error MSB4064: The "OverwriteReadOnlyFiles" parameter is not supported by the "Copy" task

I am using Msbuild 4.0. When i was using Msbuild 3.5 OverwriteReadonlyfiles worked without any issue.

But today when i was trying to use the copy task i am getting this issue.

error 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.

This is my target which has copy task

<Target Name="CopyBOM">

    <Copy SourceFiles="@(BOM)" DestinationFolder="%(BOM.Destination)" OverwriteReadOnlyFiles="true">
      <Output TaskParameter="CopiedFiles" ItemName="CopyBOMFiles" />
    </Copy>

    <Message Text="Copied to BOM: @(CopyBOMFiles)"/>


  </Target>

Following is the itemgroup i am using in my properties file

 <BOM Include="..\..\..\Release\CoreDeployment.msi">
      <Destination>..\..\..\Core\BOM\Comp1</Destination>
 </BOM>

I am having multiple properties file, I have verified that in all the place Toolsversion=4.0 is placed. Has any one faced this? Any way is there to solve this?

like image 454
Samselvaprabu Avatar asked Dec 04 '22 05:12

Samselvaprabu


1 Answers

I'm using OverwriteReadOnlyFiles="true" without issues. Try to add ToolsVersion="4.0" into your Project tag:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
like image 131
Ludwo Avatar answered Dec 27 '22 09:12

Ludwo