Problems with MSBUILD tasks after playing with Visual Studio 2010

I use a custom MSBUILD xml file to build some of my projects so that i can run stuff to compress CSS/JS files and stuff like that. After installing Visual Studio 2010 and playing around a bit with suddenly my builds started to fail.

C:\Program Files (x86)\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.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets(130,5):
error MSB4063: The "Copy" task could not be initialized with its input parameters.

After some debugging i realized that Visual Studio 2010 had changed a line in the csproj file of my web application project.

From:

To:

I just had to change this line back to v9.0 to get it to work again. Hopefully this can help someone that has the same problem as me.

UPDATE!

Now when the RTM of Visual Studio was released i of course ran into this problem again. This time i tried to find a better solution and found this post on devlicio. In the comments to that post i found a solution that worked great for me.

I had the same issue. I had to alter the MSbuild WebApplication file located: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications and remove these entries.

Retries=”$(CopyRetryCount)”

and          RetryDelayMilliseconds=”$(CopyRetryDelayMilliseconds)”

Once both of these were removed (in 13 places) everything worked fine. Hope it helps you too.

5 Responses to “Problems with MSBUILD tasks after playing with Visual Studio 2010”

  1. Hi
    I had the same message. I had to change path to MSBuild to the one that comes with .NET 4.
    And it works :)

  2. That’s a winning fix in the update! Love it, Saved my day!

  3. This worked for me also. Thank you so much. I’ve wasted a day instead of a week now!

  4. [...] one form my PCs V9.0 directory all was OK, but then I found this post that sugested to just removed the offending parameters in the targets file, they are just …! Once I did this the build attempted to compile the solution (and I checked it still worked for my [...]

  5. [...] one form my PCs V9.0 directory all was OK, but then I found this post that sugested to just removed the offending parameters in the targets file, they are just …! Once I did this the build attempted to compile the solution (and I checked it still worked for my [...]

Leave a Reply