November Happy Hour will be moved to Thursday December 5th.

Problem with WindowsMembershipProvider

Vote:
 
This error appeared in RC2 after a fresh installation: When trying to access any page in Edit mode no page in the right view can load. The following exception is thrown: Object reference not set to an instance of an object. Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] EPiServer.UI.Edit.UserMembership.EnableFields() +351 EPiServer.UI.Edit.UserMembership.OnLoad(EventArgs e) +1134 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 ... This is caused by the UserMembership.EnableFields being unable to load the current user using the Membership.GetUser(string) method. I found that the cause of this was that I was logged in with only my username, not my domain (in this case: "gusjoe" instead of "EPNET\gusjoe". I guess there is some bug in EPiServer.Security.WindowsMembershipProvider...
#15695
Jun 05, 2007 16:46
Vote:
 
Hi Gustav Im tried to reproduce this problem. But couldn't..need little more information. Questions: - You said you logged in as "gusjoe" without domain name, which groups are "gusjoe" member of? - Are you using a AD as domain log in? - Is it all pages in Edit mode that can't load and throws exception or just "Root" page and "My settings" page?
#16165
Jun 11, 2007 17:06
Vote:
 
We're using an AD, but "gusjoe" is also a member of the local Administrators groups. No pages in the right frame in the Edit mode can load. Not the start page, not Recycle bin, nothing. The menu to the left works fine, and so does the File manager/workflow frame. Admin mode works fine too. I tried to use the Membership.GetUser(string) like it's done in EPiServer.UI.Edit.UserMembership.EnableField() in a TemplatePage when logged in (without the domain prefix). It returned null.
#16166
Jun 12, 2007 9:26
Vote:
 
This is some local problem and we need to do some more testing. We have been moved up this issue to our bug database.
#16167
Jun 13, 2007 10:19
Vote:
 
This is definitely a local problem. My collegue who is on the same AD doesn't have this problem. I did some more research, and the problem seems to be the translation between the NTAccount and the SecurityIdentifier. SecurityIdentifier identifier = (SecurityIdentifier)account.Translate(typeof(SecurityIdentifier)); The problem is not really EPiServer related then, but you could possibly solve it by using the Win32 API function LookupAccountName instead. I've tried it, and it can correctly translate between my username and its SID.
#16168
Jun 13, 2007 15:27
Vote:
 
Thanks..updated the issue with you information.
#16169
Jun 13, 2007 15:52
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.