Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...User and SuperUser Manager fail with null reference exceptionUser and SuperUser Manager fail with null reference exception
Previous
 
Next
New Post
5/25/2006 5:04 AM
 

User and SuperUser Manager fail with null reference exception

Problem

When clicking the <Users> icon in the Admin Panel,  or clicking the <SuperUser Accounts> in the <Host> menu I am getting a Null Reference Exception failure.

Analysis

The exception occurs in the ConvertMembershipToUserInfo function of of the UserAccounts class in the DotNetNuke.Modules.Admin.Users namespace that just returns a null object when it finds a username in the ASP Membership without having related data in the DNN Users table.

The reason why the ASP aspnet_Users table and the DNN Users table were out of sync in my case (but there might be other reasons as well!) was that I have forgotten to clean up the ASP membership tables (e.g. aspnet_Users table) before (re-)installing a new DNN instance.

Solutions

In my case it was enough to delete the non-synchronized username from the ASP Membership tables (in my case it has been “host” and “admin” that have been created by default along the previously failed installation) as follows:

 

1.      From the aspnet_Applications table determine the ApplicationID of your current application.

2.      With this ApplicationID determine the UserIDs of your problematic (out of sync) usernames (in my case : “host” and “admin”)

3.      Knowing these UserIDs delete the such related records from the following tables (mind the sequence to comply with referential integrity):

  • Aspnet_Membership
  • Aspnet_Profile
  • Aspnet_UsersInRoles
  • Aspnet_Users

That’s it

Pending issues and recommendation for improvement

Although it is absolutely my fault that has caused the problem here (not deleting old data from previous installations) there might be other reasons why the ASP Mebership tables (e.g aspnet_Users and the DNN pairs (e.g bsDev_Users) will be out of sync àGeneric issue.

So, instead of displaying a (more or less meaningless, hard to understand) exception message, it would be better to handle this issues more defensive.

A possible solution could be to still display all the UserNames that can be fetched from either the ASP or DNN User tables and then highlighting the ones that are out of sync.

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...User and SuperUser Manager fail with null reference exceptionUser and SuperUser Manager fail with null reference exception


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out