Click here to Skip to main content
15,885,216 members
Articles / Programming Languages / XML

Resolve MSB4064: The "Retries" parameter is not supported by the "Copy" task – Team Build

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
25 Feb 2011CPOL 22.6K   1   1
Resolve MSB4064

When building Visual Studio 2010 projects on TFS 2008, you may get this error:

MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(132,11): error MSB4064: The "Retries" parameter is not supported by the "Copy" task. Verify the parameter exists on the task, and it is a settable public instance property.

MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(130,5): error MSB4063: The "Copy" task could not be initialized with its input parameters.

The item to notice is that Visual Studio 2010 projects by default use the MSBuild V10.0 targets, and the target definitions are updated for TFS 2010 build projects not TFS 2008. A simple way to address this is to add a condition on the project file to use the Visual Studio 2008 build targets instead when the build is not done with Visual Studio.

This is done by editing the Visual Studio project file and updating the following entry:

XML
<Import 
   Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\
            WebApplications\Microsoft.WebApplication.targets" />

To the following:

XML
<Import 
    Condition="'$(IsDesktopBuild)' == 'true'" 
    Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\
             WebApplications\Microsoft.WebApplication.targets" />

<Import 
    Condition="'$(IsDesktopBuild)' == 'false'" 
    Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\
             WebApplications\Microsoft.WebApplication.targets" />

The IsDesktopBuild variable is true when the build is done on Visual Studio. When is false, it is a build done over the command line. For this case, we tell the project to use the v9.0 targets instead.

XML
<!--After making this change, you may now be getting this error:error MSB4131: 
    The "Reason" parameter is not supported by the "GetBuildProperties" task. 
    Verify the parameter exists on the task, and it is a gettable 
    public instance property.
    You can add a property to the SolutionToBuild node as follows:
    ( modify the MSBuild project file):
    
    <SolutionToBuild Include=...> 
        <Properties>ProjectToolsVersion=3.5</Properties>
        <Targets></Targets>
    </SolutionToBuild>
-->

I hope it helps!

This article was originally posted at http://ozkary.blogspot.com/feeds/posts/default

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect OG-BITechnologies
United States United States
Software engineer, author & speaker who enjoys mentoring, learning, speaking and sharing with others about software development technologies. Microsoft MVP.

My Blog

Comments and Discussions

 
Questionfrom command line Pin
Polymorpher20-Jun-11 6:22
Polymorpher20-Jun-11 6:22 
is there a way of doing this from the command line?

--
"Keyboard not found. Press &lt; F1 &gt; to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.