Ang3lFir3 – Life as a Code Poet

February 3, 2012

Chewie article in Visual Studio Magazine

My friend and Chewie contributor Ian Davis does more than just help out his fellow OSS project owners. He also writes some of the best articles in Visual Studio Magazine. It just so happens that today he wrote an article on using Chewie to clean up Nuget dependancies.

BTW Ian is also the guy behind Toji which makes it even more awesome to use Psake.

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.

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.