views:

73

answers:

5

This is absolutely ridiculous! Visual Studio is able to run (debug) my program just fine, but it won't display my layout in the designer. It just gives this useless error:

alt text

Can anyone help explain this? I have not changed the XAML at all, not a single character, since the last time it worked fine. I've only changed some .cs code.

A: 

Have you tried doing a rebuild? In the past I have noticed that this happens if the compiled code is out of date.

Justin Ethier
Yes, I did try that. It doesn't fix the problem, unfortunately.
Adam S
Sorry, I should have said, I appreciate your response.
Adam S
A: 

See this: XAML Designer failing to render - UserInitiatedNavigationPermissio

Basically, that looks like bug that is fixed in Visual Studio 2008 SP1. If you already have SP1, then run repair installation of VS2008 (go to Add/Remove and then select Repair option)

Also see this StackOverflow questions:

zendar
I will try that! Thanks!
Adam S
Unfortunately, VS SP1 doesn't work either.
Adam S
+2  A: 

because VS is cripple in terms of Xaml editing. Just turn off that designer, http://www.thejoyofcode.com/Using_the_Source_Code_Editor_for_XAML_in_Visual_Studio.aspx

Kai Wang
A: 

This sometimes happens when the application must use some data that is gathered at runtime to render properly. I've had this problem when my controls are bound to data in a web service.

Seabass__
A: 

Have you tried Expression Blend? It has a better design view, you can edit the cs code (though the Intellisense is limited) and you can run the debugger.

While it's not a full replacement (it's not meant to be) it does mean you don't have to continually swap between Blend and Visual Studio if you're just modifying the UI.

ChrisF