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