Skip to main content

Microsoft Silverlight

Answered Question RiaContext.Current.Authentication.LoadUser Intermittent ErrorRSS Feed

(0)

TerryL
TerryL

Member

Member

29 points

29 Posts

RiaContext.Current.Authentication.LoadUser Intermittent Error

I am developing a Silverlight application with a login using RIA Services using VS2008.  It works 100% on my main dev machine.

When I copy the solution to my laptop (except the web.config file) and run it in VS2008, it works once in a while (maybe 1 time in 20).  The rest of the time I get a NotSupportedException, "The URI prefix is not recognized" at the LoadUser call in the MainPage constructor ( I also tried this code in the Loaded event with the same result.) 

Here's the code:

 

        public MainPage()
        {
            InitializeComponent();
            this.loginContainer.Child = new LoginControl();
            RiaContext.Current.Authentication.LoadUser();

            // need to change menu with login & logout
            RiaContext.Current.Authentication.LoggedIn += Authentication_LoggedIn;
            RiaContext.Current.Authentication.LoggedOut += Authentication_LoggedOut;
  

As I said, the code works on occasion, but most times it fails.  I tried uninstalling and reinstalling RIA services.  Any suggestions?

Thanks,

Terry

 

 

terryl
terryl

Member

Member

29 points

29 Posts

Answered Question

Re: RiaContext.Current.Authentication.LoadUser Intermittent Error

Evidently the startup project is not stored in the sln file, so when I copied the solution to another machine, the startup project changed.  When I set the web project as the startup, everything started working.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities