Scenario: WCF Service using SqlRoleProvider for authentication with a Sql Server 2012 Database server. WCF is hosted on a IIS7 webserver.
please see this error:
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Web.Security.Roles.GetRolesForUser(String username)
RoleManagement is enabled.
On my local development machine (server 2012, iis7) this works fine. When I log in and call the method the roles are retrieved.
On the other server (test environment) it's not working. I can login (user is authenticated with user and pass against sql server database) but when I try and retrieve the roles for that user, I get a nullreferenceexception.
How is this possible, does anyone have any leads on to where this problem might occur?
Best regards.