LoadUser fails for default user

Aug 14, 2010 at 4:54 PM


// This will automatically authenticate a user when using windows authentication
            // or when the user chose "Keep me signed in" on a previous login attempt
private void Application_UserLoaded(LoadUserOperation operation)
            if (operation.HasError)

 The above operation results in an error because the default User object returned from GetUser is null.

I changed the following in FormsAuthenticationService.cs:

/// The default user object.
        protected virtual TUser GetDefaultUser() {
            return new TUser(){ Name = string.Empty } ;
It appears that the new user object needs to have one of it's properties initialized, or it won't get returned from the Server.