{"id":190,"date":"2026-10-12T17:11:11","date_gmt":"2026-10-12T17:11:11","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2010\/03\/09\/issues-compiling-vs2010-solutions-with-web-projects-from-nant\/"},"modified":"2026-10-12T17:11:11","modified_gmt":"2026-10-12T17:11:11","slug":"issues-compiling-vs2010-solutions-with-web-projects-from-nant","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/issues-compiling-vs2010-solutions-with-web-projects-from-nant\/","title":{"rendered":"Fixing MSB4064 When Building VS2010 Web Solutions with NAnt"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>Originally published on 2010-03-09; fully revised and updated.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This article covers a legacy build issue that still appears in older enterprise codebases: a solution with web projects compiles in Visual Studio 2010, but fails from the command line through NAnt with Copy task errors. You will learn what is happening, why the temporary workaround does not hold, and how to align NAnt configuration with the installed .NET 4 runtime.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2010\/03\/vs2010-solutions-with-web-p.png\" alt=\"VS2010 web project compile issue from NAnt\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Symptoms and error signature<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In the reported case, the build succeeded in the IDE and failed from NAnt with these errors:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript language-text\"><span class=\"hljs-built_in\">Error<\/span> MSB4064: The <span class=\"hljs-string\">\"Retries\"<\/span> parameter is not supported by the <span class=\"hljs-string\">\"Copy\"<\/span> task.\nError MSB4063: The <span class=\"hljs-string\">\"Copy\"<\/span> task could not be initialized <span class=\"hljs-keyword\">with<\/span> its input parameter.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">This pattern typically indicates that the command-line build is loading a different MSBuild\/.NET toolchain than the one used by Visual Studio.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why changing project files to 9.0 is only a temporary workaround<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A workaround was found by editing project files to point from the v10.0 web application build targets back to 9.0. That allowed compilation once, but reopening in VS2010 reverted those edits. So it is not a stable fix for active development.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting workflow<\/h2>\n\n\n\n<pre class=\"mermaid\">\nflowchart TD\n    A[Build works in Visual Studio 2010] --> B[NAnt command line build fails]\n    B --> C{MSB4064 or MSB4063?}\n    C -- yes --> D[Target NAnt to .NET 4 tools]\n    D --> E[Add .NET 4 framework section in nant.exe.config]\n    E --> F[Set vendor to Microsoft]\n    F --> G[Match version token to installed Framework directory]\n    G --> H[Run NAnt build again]\n    C -- no --> I[Investigate other build errors]\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Resolution options compared<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Option<\/th><th>What happens<\/th><th>Durability<\/th><\/tr><\/thead><tbody><tr><td>Edit project files to use 9.0 web build targets<\/td><td>Can make command-line build pass temporarily<\/td><td>Low (VS2010 rewrites settings)<\/td><\/tr><tr><td>Switch NAnt target to .NET 4 without config updates<\/td><td>Leads to config\/runtime errors (for example missing vendor attribute)<\/td><td>Low<\/td><\/tr><tr><td>Update nant.exe.config for .NET 4 and correct version tokens<\/td><td>Reported as the working fix in the original case<\/td><td>High for this legacy stack<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step-by-step fix for the reported scenario<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1) Confirm installed .NET Framework directories<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css language-batch\"><span class=\"hljs-selector-tag\">dir<\/span> <span class=\"hljs-selector-tag\">C<\/span>:\\<span class=\"hljs-selector-tag\">Windows<\/span>\\<span class=\"hljs-selector-tag\">Microsoft<\/span><span class=\"hljs-selector-class\">.NET<\/span>\\<span class=\"hljs-selector-tag\">Framework<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Use this to verify the exact v4.0 folder\/version available on the build machine.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2) Update NAnt to use .NET 4 framework definitions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The original report required extending <code>nant.exe.config<\/code> with .NET 4 framework entries because the existing config did not support the new target yet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3) Add the missing vendor attribute and align version tokens<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml language-xml\"><span class=\"hljs-comment\">&lt;!-- Example pattern inside the .NET 4 framework entry in nant.exe.config --&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">framework<\/span> <span class=\"hljs-attr\">...<\/span> <span class=\"hljs-attr\">vendor<\/span>=<span class=\"hljs-string\">\"Microsoft\"<\/span> <span class=\"hljs-attr\">...<\/span> \/&gt;<\/span>\n\n<span class=\"hljs-comment\">&lt;!-- Update copied values to match what exists on disk --&gt;<\/span>\nv4.0.20506 -&gt; v4.0.30128<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">The key point is not the sample numbers themselves, but that your config must match the actual framework version present on the server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4) Re-run the command-line build<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs language-bash\">nant<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Common pitfalls<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Relying on project-file downgrades that VS2010 will overwrite.<\/li><li>Copying a .NET 4 config block but missing required attributes such as <code>vendor<\/code>.<\/li><li>Using hard-coded framework version tokens that do not match the machine.<\/li><li>Changing build config without backing up <code>nant.exe.config<\/code> first.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For legacy pipelines, keep Visual Studio version, target framework, and NAnt framework mappings explicitly documented and version-controlled to prevent environment drift.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If a Visual Studio 2010 web solution builds in the IDE but fails from NAnt with MSB4064\/MSB4063, the issue is usually a framework\/tooling mismatch. This guide walks through the durable fix and the common missteps.<\/p>\n","protected":false},"author":1,"featured_media":4131,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[3430,3426,3420,3428,3427,1122,3113,1806,302,3423,3432,3424,1536,3431,3429,1508,213,3422,3421,3425],"class_list":["post-190","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorised","tag-command-line-compilation-error-vs2010","tag-compilation-error-in-vs2010","tag-compile","tag-compile-error-visual-studio-2010","tag-compiling-issue-in-vs2010","tag-guide","tag-how-to","tag-instruction","tag-issue","tag-msb4064-error","tag-msb4064-error-solution","tag-msb4064-issue","tag-nant","tag-nant-exe","tag-project-upgrade-to-visual-studio-2010","tag-solution","tag-tutorial","tag-visualstudio-2010","tag-vs2010","tag-web-projects"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=190"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/190\/revisions"}],"predecessor-version":[{"id":79020,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/190\/revisions\/79020"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4131"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}