Adam S
Adam S

Reputation: 9235

Why can VS not display my WPF application in the designer, but it can run it just fine?

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 http://img6.imageshack.us/img6/8661/vserrorscreenshot.png

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.

Upvotes: 1

Views: 347

Answers (5)

ChrisF
ChrisF

Reputation: 137148

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.

Upvotes: 0

Seabass__
Seabass__

Reputation: 871

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.

Upvotes: 0

treehouse
treehouse

Reputation: 2531

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

Upvotes: 2

zendar
zendar

Reputation: 13572

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:

Upvotes: 0

Justin Ethier
Justin Ethier

Reputation: 134177

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

Upvotes: 0

Related Questions