ASP.NET MVC Custom RoleProvider cannot retrieve roles from database for username
问题 i cant seem to find the right solution for the above issue. I keep getting System.NullReferenceException: Object reference not set to an instance of an object. i followed this guide http://techbrij.com/custom-roleprovider-authorization-asp-net-mvc The error message is from my custom roleprovider from the GetRolesForUser(string username) at line var user = _VisitorService.GetVisitors().FirstOrDefault(u => u.Username == username); The VisitorService works in the Controller but not in the