XamlParseExceptions in Design mode - making design mode useless

Go To StackoverFlow.com

1

OK, so i have an MVVM Silverlight app

and recently, it seems every single one of my views throws an XamlParseException because it cannot find static resources that i have defined in my app.xaml file.

I am positive that these views all used to work in design mode, but none of them do anymore.

Cannot find a Resource with the Name/Key VisibilityFormatter [Line: 15 Position: 28] at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at USRWeb.Main.Views.Scheduling.SeatDetails.InitializeComponent() in xxx\obj\Debug\Views\SeatDetails.g.i.cs:line 63 at USRWeb.Main.Views.Scheduling.SeatDetails..ctor() in xxx\Views\SeatDetails.xaml.cs:line 25

so, why did this all of a sudden change on me, and how do i work around it?

2012-04-05 20:11
by kylepike
Are you doing anything in the resources that you're loading (like calling a web service)? Typically this error happens when you aren't checking if you're in design mode and make service calls and such - Bryant 2012-04-05 23:02
my viewmodels all have a design mode exclusion in their constructors. this is failing on the view wireu - kylepike 2012-04-13 14:00


0

It looks (to me) - as Bryant has suggested, that you have added in a control to the page that is missing a check for designer mode.

SeatDetails.g.i.cs is a generated file, which I think is generated as the invisible code behind to declare your controls, etc on your page. One (or more) of those controls looks to be trying to run some code it shouldn't, when in design mode.

2012-05-15 21:34
by BaconSah
what's odd is that the seatdetails control doesn't use a declarative datacontext. it's set only in another vm's constructor. so there's nothing to exclude - kylepike 2012-05-30 17:58
Ads