Switching from Silverlight 3 Tools to Silverlight 2 Tools

Silverlight 2 projects can't be created with the Silverlight 3 Tools for Visual Studio 2008.  When Visual Studio 2010 is released, you will be able to build both Silverlight 2 and Silverlight 3 with the same IDE.  But for the immediate future, you will need Silverlight 3 Tools to build Silverlight 3 projects and Silverlight 2 Tools to build Silverlight 2 projects.

If you already have Silverlight 2 Tools installed, you can easily upgrade to Silverlight 3 Tools by running the Silverlight 3 installer.  To downgrade from Silverlight 3 to Silverlight 2 tools, you will need to uninstall "Microsoft Silverlight" and "Microsoft Silverlight Tools for Visual Studio 2008" from Add/Remove programs before re-installing Silverlight 2 Tools.

If you plan to switch frequently between Silverlight 2 and Silverlight 3, the utility below should make the process a little faster.

Setup

  1. Download Silverlight_Tools_Util.zip, and unzip
  2. Download the Silverlight 2 Tools and save Silverlight_Tools.exe in the Silverlight_Tools_Util folder
  3. Download the Silverlight 3 Tools and save Silverlight3_Tools.exe in the Silverlight_Tools_Util folder
  4. If you haven’t previously, run Silverlight_Tools.exe to install the Silverlight 2 Tools and SDK
  5. If you haven’t previously, run Silverlight3_Tools.exe to install the Silverlight 3 Tools and SDK
  6. Run Setup_SLTools_Util.bat to generate switching scripts

To install Silverlight 2 Tools for Visual Studio

  1. Close Visual Studio
  2. Run VS_3-to-2.bat

To install Silverlight 3 Tools for Visual Studio

  1. Close Visual Studio
  2. Run VS_2-to-3.bat

To install Silverlight 2 Tools for Visual Web Developer Express

  1. Close Visual Web Developer Express
  2. Run VWDx_3-to-2.bat

To install Silverlight 3 Tools for Visual Web Developer Express

  1. Close Visual Web Developer Express
  2. Run VWDx_2-to-3.bat

To downgrade a project from Silverlight 3 to Silverlight 2

  1. Open the .csproj or vbproj file in a text editor
  2. Change
    <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" Condition="" />
    To
    <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v2.0\Microsoft.Silverlight.CSharp.targets" Condition="" />

Silverlight_Tools_Util.zip