Ang3lFir3 – Life as a Code Poet

August 2, 2010

Upgrading web projects from VS2008 to VS2010

So while upgrading a project from VS2008 to VS2010 at work I was under the impression that pretty much everything went pretty easy. That was of course until I tried running the psake build and hit the publish task.

My publish task looks as such:

   1:  task publish -depends set_prod_configs {
   2:      & $msbuild $web_proj_file /p:WebProjectOutputDir="$publish_dir\" `
   3:                  /p:OutputPath="$publish_dir\bin" `
   4:                  /p:Configuration=$configuration `
   5:                  /p:Debug=false `
   6:                  /t:"ResolveReferences;Compile;_CopyWebApplication"
   7:  }


pretty tame… but after converting this was failing with:

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.
error MSB4063: The “Copy” task could not be initialized with its input parameters.

The solution while obvious took a little while to emerge. This problem seems to occur when continuing to use the .Net 3.5 version of MsBuild. However the proj files are updated to use the .Net 4.0 WebApplication targets.

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

So the simple solution to the whole obvious problem… was… use the .Net 4.0 version of MSBuild (Duh!). I had found lots of posts saying to remove some sections of the targets files and other such suggestions. This however seemed fishy to me (plus not feasible on my CI server) which is why I continued looking for a better answer. Once I realized that the targets file had been updated then it became obvious that I was trying to use .net 4.0 build targets with .net 3.5 MsBuild.

Hope this helps someone… and so I don’t make the same mistake twice.

About these ads

1 Comment »

  1. Thanks. It really is a D’Oh! moment, but it fixed my problem.

    Comment by zeristor — March 14, 2012 @ 4:09 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Get a free blog at WordPress.com

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: