I am trying to open site(FBA enabled with custommembership & customroleprovider) through module/httpmodule. It is throwing error
System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.SPSecurity.GetRolesForUser(String roleManagerName, String userName, UInt32& roleCount, String& roles)
Here is the code:
HttpRequest r = HttpContext.Current.Request;
using (SPSite s = new SPSite(r.Url.AbsoluteUri))
{ ......}
Please provide me if there is any solution
Regards.