locked
Unhandled Exception Code: 4004 RRS feed

  • Question

  • I've been writing asp.net apps for years and years.  I wrote Silverlight RIA Services apps for about 6 months.  Now I'm using WCF RIA and experiencing a problem with VS 2008 I've never seen before.

    When starting a SL3 WCF RIA Business Application in debug mode, about 1 out of 5 times I get the following error when trying to access SQL Express 2008:

    An unhandled exception ('Unhandled Error in Silverlight Aplication

    Code: 4004

    Category: ManagedRuntimeError

    Message: Syste.Windows.Ria.DomainOperationException: Invoke operation 'GetUserGuid' failed.  Login failed for user 'xxxxx'.

    It then askes to use a debugger.  The failed login is for the login to SQL Express 2008.

    Stopping the appliction and restarting produces the same error.  Closing VS 2008 and opening the same project, then running works just fine, for about 5 times.  Then the error shows back up.

    The application actually runs fine, it's when I try to log in to the Business Application, or more specifically, access a WCF RIA service that requres database access, in this case the AuthenticationService.  It's clear RIA is failing to log in to the DB.

    Yes, all my security is set up correctly on the DB.  After I get the error, I can still access the database from within VS 2008 Server Explorer.  I am using LinqToSQL for database access from within WCF RIA.

    Thanks

    Tuesday, February 23, 2010 2:36 PM

Answers

  • I ended up recreating the SL3 Business Application, then copied all my code files into the new project, and the error has gone away, at least so far.

    Not a single code change, so it has to be a solution/project setting, or a bug in the RIA auto code generation system.

    I still have the old project that has this problem if anybody is interested in trying to find a solution, or has any suggestions I can try.  It's such a strange issue, with code things either work or not, seeing a problem 1 out of 5 times is very strange......

    Tuesday, February 23, 2010 3:45 PM