Derik Whittaker



Issues Compiling VS2010 solutions (with web projects) from Nant

Recently I upgraded a project of mine (the Dimecasts code base) to use VisualStudio 2010.  In the process everything worked just fine from the IDE, but when I tried to compile it from the command line I would get the following errors:

Error MSB4064: The "Retries" parameter is not supported by the "Copy" task.
Error MSB4063: THe "Copy" task could be initialized with its input parameter.

After a bit a googling I came across a post which (and of course i cannot find it now) said that if you open up your .proj files and change the line that pointed to the v10.0 build of web applications and reset it back to 9.0 everything would compile.  And this did work... BUT when you try to open that project up again in VS 2010 it will simply revert your changes... this is not a working solution.

Next I decided to switch my target framework in Nant from 3.5 to 4.0, but of course my nant.exe.config file does not support 4.0 yet.  So after a bit more googling I found this post that gives details on how to add the missing values to the config file.

When I added the config information to my Nant.exe.config file things were better, but still not great.  Now I was getting an error that said:

The "vendor" attribute does not exist, or has no value.

To resolve this I added the following under the <framework> node in my config

After this I got another error.... This time it said that .Net Framework 4.0 was not installed.  But I know this is not valid.  After looking at the information for a few more seconds I realized the issue.  The example config from the post above was build on an older version of the 4.0 framework (.20506) and I have .30128.

I changed all values in the nant.exe.config value that was v4.0.20506 to be v4.0.30128 and NOW I am able to compile.

So long story short, if you are getting the MSB4064 error you need to do the following:

  1. Point nant to use the 4.0 framework tools
  2. Follow this post  and copy the framework section to your Nant.exe.config file
  3. Add the missing 'vendor' attribute to the new framework section
  4. Update the version in the new framework section to match the version you have on disk (check C:\Windows\Microsoft.NET\Framework for versions)
  5. Compile again

Till next time,

Posted 02-27-2010 8:40 AM by Derik Whittaker



Rob Reynolds wrote re: Issues Compiling VS2010 solutions (with web projects) from Nant
on 03-01-2010 3:49 PM

Hey man, awesome post! One thing you may also want to make sure you do is update the tool paths and add a reference to the 4.0 directory.  That makes 6 places you update with the new version:


                       <directory name="${path::combine(sdkInstallRoot, 'bin')}"

                           if="${property::exists('sdkInstallRoot')}" />

                       <directory name="${path::combine(installRoot, 'v4.0.30128')}" />

                       <directory name="${path::combine(installRoot, 'v3.0')}" />

                       <directory name="${path::combine(installRoot, 'v3.5')}" />

                       <!--directory name="${path::combine(installRoot, 'v2.0.50727')}" -->


Starkey wrote re: Issues Compiling VS2010 solutions (with web projects) from Nant
on 03-03-2010 4:18 PM

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.


and          RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"

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

Ola wrote re: Issues Compiling VS2010 solutions (with web projects) from Nant
on 04-13-2010 10:06 AM


I think it was my post you found first :)

But since my solution wasn't that good i made an update and included the comment on this post about updating the Webapplications target file itself. I do not use NANT so your solution didn't really fit me.

And please update your post with a link to my post, could use the Page Rank ;)

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Google Reader or Homepage Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of
Red-Gate Tools For SQL and .NET


SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
NHibernate Profiler
Balsamiq Mockups
JetBrains - ReSharper
Web Sequence Diagrams
Ducksboard<-- NEW Friend!


Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers


Community Server (Commercial Edition)