InvalidOperationException in Silverlight designer

After creating a BasePage for all my pages and moving the DomainContext initialization to the base class, I got this design time error:

The current instance of WebContext is not available. You must instantiate a WebContext and add it to Application.ApplicationLifetimeObjects within the default App constructor.

Looks like a Silverlight bug, but all I did is checking the design time at the beginning of the constructor:

public BasePage()
{
   if (DesignerProperties.IsInDesignTool) return;
   ...
}

That’s it!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>