I some times (around 3 of 100 registrations fails) gets the exception:
System.Threading.ThreadAbortException: Thread was being aborted.
at System.String.GetHashCode()
at System.Collections.Hashtable.GetHash(Object key)
at System.Collections.Hashtable.get_Item(Object key)
at System.Data.DataColumnCollection.get_Item(String name)
at System.Data.DataRow.get_Item(String columnName)
at EPiServer.DataAbstraction.GroupSid.SaveGroupMembership()
at EPiServer.DataAbstraction.GroupSid.Save()
when trying to run this code:
GroupSid groupSid = GroupSid.Load ("XXXGroup");
UserId userId = null;
try
{
UserSid userSid = new UserSid (SecurityIdentityType.ExtranetUser);
userSid.Name = name;
userSid.Password = password;
userSid.Active = true;
userSid.Save ();
userId = new UserId (userSid.ID);
groupSid.GroupMembers.Add (userSid);
groupSid.Save ();
}
catch (Exception ex)
{
....
}
Can someone please give me some ideas on why the Save method throws this exception?
GroupSid groupSid = GroupSid.Load ("XXXGroup"); UserId userId = null; try { UserSid userSid = new UserSid (SecurityIdentityType.ExtranetUser); userSid.Name = name; userSid.Password = password; userSid.Active = true; userSid.Save (); userId = new UserId (userSid.ID); groupSid.GroupMembers.Add (userSid); groupSid.Save (); } catch (Exception ex) { .... }
Can someone please give me some ideas on why the Save method throws this exception?