Thursday, April 23, 2009

Open in Expression Blend - switch between 2 and 3

Since Silverlight 3 is available, Blend 3 Preview was also released. When installing Silverlight 3 tools it is no longer available to create Silverlight 2 applications. Thanks to Amy Dullard who created an awesome batch file/deinstaller/installer script it makes life a lot easier.

The only thing that was bugging me was Expression Blend 2 and 3. Although the Silverlight 2 tools are installed, once installed, Blend 3 is the preferred application when using the "Open in Expression Blend" option in the context menu in VS2008.
After some searching in the registry I found out that it was the following key that did the mapping:

I created 2 registry files, 1 for going from Blend 2 to Blend 3 and one for going from Blend 3 back to Blend 2. It doesn't install/uninstall anything, it just changes the value in the registry.

So after I created the registry files and copied them to the folder of the batch file that Amy created, I added the following command(s) to the corresponding batch files:
reg import Blend3-to-2.reg
reg import Blend2-to-3.reg

Now, when switching between Silverlight 2 and 3 the "Open in Expression Blend" option also switches to Blend 2 for Silverlight 2 and Blend 3 Preview to Silverlight 3.

NOTE: I created this and only tested it on a 64 bit machine. I did include x86 version of the registry keys but these are untested!

Sometimes being lazy is a good thing, right? :)

Download the registry key files