×

First time here?

You are looking at the most recent posts. You may also want to check out older archives. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS or email. Thank you for visiting!

If you’ve been working with Visual Studio 2008, Expression Blend 3 and Silverlight (or WPF) development, you’ve likely used the Open in Expression Blend feature in Visual Studio.  This occurs when you right-click on a XAML file in your project/solution and you’ll see that option as long as you have Expression Blend 3 installed.

Well…if you are an eager developer and have installed VS2010 and the Blend Preview for .NET 4, you may have noticed that integration broken.

Problem 1: VS2010 and Blend Preview for .NET 4 on a clean box – NO LINK

You’ve just fired up a new virtual PC or you have a clean install and you’ve installed Visual Studio 2010, the Silverlight 4 tools and Blend Preview for .NET 4.  You start your new XAML development project, add some code, then want to use Blend.  You right-click and see this:

Missing Open in Blend option

Nothing.  No option.  You miss that convenience of immediately opening the solution/file from VS to Blend and want it back.  You are confused because you have both installed!

Problem 2: VS2010 shows me the link, but it opens in Expression Blend 3

The other problem you may face is that you have VS2010, Blend 3 and Blend Preview for .NET 4 installed.  You see the Open in Expression Blend option, but when you click on it expecting it to open the latest Blend, it opens your VS2010 project in Blend 3 (or tries to) and fails.  You want to change this to open in Blend Preview for .NET 4.

Solution

I have a solution for you and luckily it is a fairly easy one. 

First, a warning that “here be dragons” – this is a registry editing procedure.  If you aren’t familiar with editing your registry, or don’t know what it is (highly unlikely), then you shouldn’t be doing this.  Screwing up your registry can cause irreparable damage and may harm small kittens in the process.  Seriously, you’ve been warned so don’t email me if your machine explodes into a pile of dust.  Hey, it works on my machine.

With the warning aside, here’s the fix.  Basically Visual Studio looks for a specific key in the HKLM (that’s HKEY_LOCAL_MACHINE to you registry noobs) for where to launch Expression Blend.  There is only one setting though, so this will apply for any VS instance you have installed.  Once you implement the registry setting you’ll see the option:

Open in Blend from Visual Studio

It is located in HKLM\Software\Microsoft\Expression\Blend – there is a key that VS is looking for there named “VS” with one String value named “BlendLaunchPath” which has the full path to the version of Expression Blend you want to launch.

   1: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Expression\Blend\VS]
   2: "BlendLaunchPath"="\"c:\\Program Files\\Microsoft Expression\\Blend Preview for .NET 4\\Blend.exe\""

So if you are missing the link or want to change the link that exists (because you are running Blend 3 and Blend Preview for .NET 4 side-by-side – which can be done if you didn’t know that) all you have to do is change that path.

Works on my machine logoI’m providing a ZIP file of the registry file you can merge (a .REG file) for both 32-bit or 64-bit (x64 is in the Wow6432Node) that will automatically add this setting for you assuming you have Blend Preview for .NET 4 installed in the default location.  You can get that ZIP file here: OpenInBlendRegHack.zip.

Hopefully this is a helpful little tip for you if you want to implement this integration between the beta of VS and the preview of Blend.  I use this integration a lot and it’s nice to have it working with the new tools and not miss anything.  REMINDER: Changing this registry change makes it changed for both VS2010 and VS2008...be warned.  Hope this helps!


This work is licensed under a Creative Commons Attribution By license.


11/22/2009 9:07 PM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
Tim -
Thanks for this, it worked great on my system.

-Damien
11/23/2009 8:51 AM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
Great, thank you for the quick response. (I had problem #1)
I exploded the zip and ran the 32 bit reg file and all is good now.
11/23/2009 2:01 PM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
A few notes from the nitpick dept:

"(x64 is in the Wow6432Node)" - Actually, x86 is in the Wow6432Node, it's the WOW64 node, for apps that are 32-bit but running on 64-bit OS. This is the same reason that all the 32-bit DLLs are stored in SysWOW64, but everyone thinks they're the 64-bit DLLs.

"for both 32-bit or 64-bit" - Is there an existing key already in Wow6432Node that you're overwriting here? It should be sufficient to just put it in the normal location; when a WOW64 process tries to read it (like VS), RegCreateKeyEx checks the Wow6432Node, sees it doesn't exist, then reads the normal key.
11/25/2009 12:06 PM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
Works on my machine too. Many thanks for posting this!
11/30/2009 9:04 AM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
Without trying this myself, would u know if I open the same solution in Blend4preview and VS2010beta2, will they both "know" if I make changes in the other environment and offer to "update external changes"??

I don't mess w Registry. Against my religion.
11/30/2009 9:59 AM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
austin -- yes, if you manually open the project, the modifications to the solution/project files would trigger appropriate change notifications to the other tool (if the project is opened)
12/17/2009 2:50 AM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
I was afraid of breaking the link among Visual Studio 2008 and Blend 3 installing the Blend preview side by side.

Thank you
12/31/2009 4:17 PM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
Hi Tim, I want to use VS2010 beta 2 and blend in to create a silverlight 3 app. It seems this is not possible because

a) blend 3 does not understand vs2010 project files AND
b) blend 4 preview does not allow me to edit silverlight 3 projects

asking end customers to install a SL4 beta to use the end result is not an option.

I suppose I must be missing something? maybe there is a patch I can use or another workaround or perhaps I've misunderstood? I'm nervous about ignoring the warning about opening my vs2010 project files and solution in blend 3 as I read another persons blog entry lamenting how his solution was munched after doing so.

regards
ewart
12/31/2009 4:21 PM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
ewart -- as noted above, this is an issue if you are doing SL3 development with VS2010...if you need that blend solution integration...stick with VS2008 for now.
1/8/2010 12:38 PM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
hey I ran 64bit reg. its now shows 'open with expression blend' option but gives error system can not find path. can somebody help me
1/28/2010 9:43 PM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
Thanx bro ...
1/31/2010 5:55 AM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
appa - this fix works only if you've installed blend in default location, otherwise you have to manually edit path to blend
1/31/2010 10:15 PM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
Tim,

I have VS2010 Beta 2, Blend Preview 4 running. All my SL3 with vs2008 is still installed.

When I create a new SL4 project OR add a new SL4 user control VS automatically launches Blend Preview, then it says the xaml is not a project file.

How can I turn off this behavior?
2/18/2010 8:12 AM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
I have a problem which i cannot seem to solve...
I have installed Visual Studio 2008 Team, and Expression Blend 3.. However I cant seem to be able to enable the |Open in Expression Blend| feature in Visual studio...

How can i turn ON this feature? ...
I would be very thankfull
3/2/2010 2:13 PM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
Dan -- yes you can.
6/16/2010 9:02 PM | # blend 4 rtm - not opening
so after the upgrade to blend 4 rtm i have this problem and the reg edit hack when modified to use the folder name of the rtm build of blend still does not work.
3/29/2011 6:54 AM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
I did according to you and install the zip file but when i try to open xaml file in blend after right click on it in vs then I got the eroor "The system can not find the file specified."
plz tell me what to do now.
thanks
4/10/2012 5:25 AM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
i have the first problem but i don't know how to solve it
4/12/2012 2:12 AM | # re: Fixing Visual Studio 2010 and Blend Preview for .NET 4 integration
sorry but how to fix vs2010 and blend preview for.net 4 integration

 
Please add 1 and 5 and type the answer here:

DISCLAIMER:

The opinions/content expressed on this blog are provided "ASIS" with no warranties and are my own personal opinions/content (unless otherwise noted) and do not represent my employer's view in any way.