Great tips noobie. I've use the one where you turn on the exceptions but hadn't tried attatching to blend.
I ended up fixing the problem by adding a new user control and pasting in my xaml and code. It was strange I had two almost identical pages (only the class names different) and one worked the other didn't. Dragging them and dropping from the other project must have messed up something inthe project file or solution file I've been noticing blend doing weird stuff lately such as not showing the correct properties for the selected item. Close solution and reopen and it's ok again. Might be due to the size of my file I've got a load of stuff imported from illustrator (via design) in there. On 2/10/09, .net noobie <[email protected]> wrote: > one way to help work out blend errors is.... > > > - open project in VS, then I open the project in Blend from Visual studio > (so project is open in both VS & Blend) > - next in VS click the "Debug" menu, and select the "Attach to Process", > select the "Blend.exe" and click "Attach" > - next in VS click the "Debug" menu again and select "Exceptions", tick > the "Common Language Runtime Exceptions" in the "Thrown" column > - next return to the Blend IDE and open your usercontrol/style what ever > is having the issue > > this does not always work but often will break in VS on the problem line of > code that is stopping the control/style whatever from displaying correctly > in blend > > > Also, if you are making a control and in the OnApplyTemplate, Constructor or > Load events for example if there is a object trying to populate with an > instance of something that is null when you open in the blend IDE, but may > not be null when you actually run the project in the web browser you will > also get it crashing in Blend > > this can be trying to hook up events for a object as well, when in Blend the > object/control whatever is null so I generally wrap these in something like > below.... > sometimes I also need to do this is other locations in the code, which doing > the Attach Process in Debug menu will often show me, but generally it is > only in the OnApplyTemplate, Constructor or Load methods > > > public myControl() > > { > > DefaultStyleKey = typeof(myControl); > > > > if(HtmlPage.IsEnabled) > > { > > // Hook up events, populate objects etc here... > > } > > } > > > > These are the two ways I get my controls to display in Blend correctly, > > HtmlPage.IsEnabled = false you are in Blend, > HtmlPage.IsEnabled = true you are running in the browser > > > > On Mon, Feb 9, 2009 at 9:38 AM, Stephen Price > <[email protected]>wrote: > >> Help! >> Has anyone seen this error before? >> >> "The root type was not expected. The following type was expected: >> "Application'." >> >> I've refactored some user controls into their own project/assembly >> (Created >> the project as "Silverlight Class Library") and when I open one of the >> xaml >> files in Blend it throws that error and won't show anything in design. >> Have >> found one other person post this a year ago on the Silverlight forums with >> no answer. >> >> I'm sure I've done this before without error. Any ideas? >> >> cheers, >> Stephen >> ------------------------------ >> Support procedure: https://www.codify.com/lists/support >> List address: [email protected] >> Subscribe: [email protected] >> Unsubscribe: [email protected] >> List FAQ: http://www.codify.com/lists/ozsilverlight >> Other lists you might want to join: http://www.codify.com/lists > > > > > -- > net noobieâ„¢ > > ========================= > > What is the 'Clean Feed'? > > No!!! Forced Australian Federal Government Internet Censorship > > http://nocleanfeed.com/ > -------------------------------------------------------------------------------- > Support procedure: https://www.codify.com/lists/support > List address: [email protected] > Subscribe: [email protected] > Unsubscribe: [email protected] > List FAQ: http://www.codify.com/lists/ozsilverlight > Other lists you might want to join: http://www.codify.com/lists > > -------------------------------------------------------------------------------- Support procedure: https://www.codify.com/lists/support List address: [email protected] Subscribe: [email protected] Unsubscribe: [email protected] List FAQ: http://www.codify.com/lists/ozsilverlight Other lists you might want to join: http://www.codify.com/lists
