Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

One of my favorite features in Expression Blend is the ability to attach a Visual Studio debugger to Blend. First let’s start by answering the question: why exactly do you want to do that?

Read the rest of this entry »

Print | posted on Wednesday, September 5, 2012 11:53 PM

Feedback

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by Chris at 9/6/2012 9:01 AM Gravatar
Hey Laurent,

To get this to work, I had to switch the 'Attach To' part of the 'Attach To Process' dialog to be be 'Managed (v4.5, v4.0) code', removing the 'Automatic' part, as it wouldn't load the debug symbols otherwise...

Ta!
Chris

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by Laurent at 9/6/2012 9:38 AM Gravatar
Hi Chris, very good point, I will update the article. Cheers!

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by Graham at 10/21/2012 12:22 PM Gravatar
Chris, that is strange..... magnificent find though, it helped me as well, simply would not debug on 'Automatic: Managed (v4.5, v4.0) code' which should be the same thing :)

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by Rob de Beir at 11/24/2012 5:43 PM Gravatar
Thanks a lot, did not understand why the attach did not work anymore, but thanks to your explanation got it working again.

By the way if you suspect (or as a first step) that there is an error in the design data service, just make a small change in the ViewModelLocator (make the design service temporarily the real service) and run the app to see if there is an exception (much faster to do this than the attach method, but you have to remember to switch back to the real service :)

if (ViewModelBase.IsInDesignModeStatic)
{
SimpleIoc.Default.Register<IDataService, DesignDataService>();
}
else
{
// in case you want to test the DesignService
// SimpleIoc.Default.Register<IDataService, DesignDataService>();
SimpleIoc.Default.Register<IDataService, DataService>();

}

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by Laurent at 11/24/2012 6:15 PM Gravatar
That's a good tip, and in fact I do use that often too. Sometimes the design tune data service throws other exceptions when run in the context of Blend, but this first easy can really help getting most of the errors out of the way :)

Cheers
Laurent

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by Josef at 12/20/2012 8:42 PM Gravatar
Folks, this drives me crazy. I fighting blend since a week or so. I do not get the design data Displayed nor it stopps at break Points in debug. What can I do to find out whats wrong.

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by Alan McBee at 2/12/2013 2:04 AM Gravatar
Laurent, you're a life-saver!

Also, I found that if you hover your mouse cursor over the two XDesProc.exe processes listed in the Attach to Process dialog, Visual Studio 2012 will provide a tooltip after a second that shows the entire path to the process. The paths are different; the one for Blend clearly appears to be in a path with the word "Blend" in the path, whereas the Visual Studio process does not.

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by Laurent at 2/12/2013 7:55 AM Gravatar
Well I didn't know that :) Good find.

Cheers
Laurent

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by James at 5/2/2013 11:31 PM Gravatar
This is not working for me. I followed directions and suggestions to the tee. I use VS 2012 ultimate.

# re: Adventures in Windows 8: Understanding and debugging design time data in Expression Blend

left by James at 5/3/2013 12:35 AM Gravatar
Nevermind. I Guess I was doing something wrong with Unity where the viewModel constructor was never getting called. I got it working with the default IoC container from the toolkit.
Comments have been closed on this topic.