- I started with the Silverlight Business Application Template
- I will call this MyApp and MyApp.Web
- I added a new SL application project.
- and added a ria link to the existing web project.
- I will call this Loader
This new SL app is the entry point of my solution, and basically loads the mainpage from the other xap file. Checks for updates, etc.
- I removed the App.xaml and App.xs files from MyApp
- Because Loader is now the Application
- I copied the relevant code from MyApp - App.cs to Loader - App.cs
- I added the relevant code from MyApp - App.xaml to Loader - App.xaml
- Mostly this is the WebContext stuff.
The problem is that the RIA Services generated code for Loader is not the same code as the code for MyApp
The generated code for MyApp contains the following namespaces:
- MyApp
- MyApp.Web
- MyApp.Web.Models
- MyApp.Web.Services
The generated code for Loader contains the namespace:
- Loader
The following line of code in Loader - App.cs throws InvalidOperationException.
WebContext.Current.Authentication.LoadUser(this.Application_UserLoaded, null);
The error msg for the exception is:
The DomainContextType is null or invalid and there are no contexts generated from
AuthenticationBase<T>