Admin key error when accessing Users page

Topics: ASP.NET 2.0
Dec 8, 2009 at 5:03 PM

I have a new sql installation of BlogEngine 1.5 that will not allow me to access the users page. Once I disabled custom errors, I am receiving the following stack trace:

[ArgumentException: Item has already been added. Key in dictionary: 'Admin'  Key being added: 'Admin']
   System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) +7484392
   System.Collections.Hashtable.Add(Object key, Object value) +11
   System.Web.Security.MembershipUserCollection.Add(MembershipUser user) +129
   BlogEngine.Core.Providers.DbMembershipProvider.GetAllUsers(Int32 pageIndex, Int32 pageSize, Int32& totalRecords) in V:\studio\Code\Projects\Blogs\apropos\BlogEngine.Core\Providers\DbMembershipProvider.cs:576
   admin_newuser.BindGrid() +50
   admin_newuser.Page_Load(Object sender, EventArgs e) +369
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Any ideas?


Dec 8, 2009 at 5:28 PM

You probably have more than one Admin user in the be_Users table in the DB ... which could be the result of accidentally running the setup script more than once.

If you're just getting started, you might want to delete all the tables in the DB, and run the setup script again ... because you might have duplicate data in some of the other tables too.

Either that, or go through the be_Users and be_UserRoles tables to clear out redundant data.

Dec 9, 2009 at 2:54 PM

You were right, Ben: I had run the setup script twice inadvertently. Thanks for the help.