Last post Feb 22, 2010 05:26 PM by Radomir
Feb 16, 2010 08:14 AM|rblaettler|LINK
This is a bit complicated...
I have my own implementation of a MySQL Role and Membership Provider. They both worked great in ASP.NET 3.5. But now with ASP.NET 4.0 RC I'm getting this exception:
[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.Security.RoleManagerModule.OnEnter(Object source, EventArgs eventArgs) +313
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
I've I remove either the roleManager or the authentication part in the web.config it works. The MySQL configuration seems to work too, since I'm getting no troubles from the MembershipProvider (that one works similar to the RoleProvider). The code and the web.config
configuration for the Providers is exactly the same as in 3.5, so I have no idea what the problem could be...
Feb 16, 2010 10:46 AM|Radomir|LINK
The code is OnEnter is nearly identical between 3.5 and 4.0.... It would be very helpful if you could send us a small repro ... I'd be happy to take a look..
Feb 16, 2010 10:58 AM|rblaettler|LINK
What exactly are you looking for? The code from OnEnter is not my code.
I just implemented the Provider and that one has been working well on 3.5
Feb 16, 2010 11:37 AM|Radomir|LINK
A sample project (minimized as much as possible) that shows the problem, along with any specific steps that need to be taken to reproduce this error. I am not able to repro the error you mentioned using my sample role provider..
Feb 17, 2010 04:47 AM|rblaettler|LINK
Ok, will give it a try. But will take some time.
Feb 19, 2010 09:20 AM|johndyer|LINK
I'm seeing the same problem.
It doesn't happen when I Debug the project in Visual Studio Professional 2010 RC, but it does happen when I let the site run under IIS7 in Windows 7 running .NET Framework 4.0 RC.
I've tried the SqlRoleProvider as well as creating a dummy RoleProvider that implements all the methods of RoleProvider, but doesn't really do anything. I'm happy to attach a sample project, but I don't have attachment permissions.
Feb 19, 2010 01:58 PM|Radomir|LINK
Pls email it to me as a zip attachment: radomirz (at) microsoft.com
Feb 22, 2010 10:58 AM|rblaettler|LINK
So, built a sample app and tried to use it with the VS built-in Webserver and oh wonder, it worked.
Now, turns out that in the Windows Features in Windows 7, the Application Development Features -> ASP.NET was not checked. No idea how the app was working so far and the Error does not really help either :-S
But seems to be working now....
You are of the hook :-)
Thanks for the help anyway.
Feb 22, 2010 11:18 AM|johndyer|LINK
My problem was the same. I did not have "ASP.NET" checked. Once I did that, it worked perfectly.
Feb 22, 2010 05:26 PM|Radomir|LINK
Just a quick note -- this has been fixed post-RC... so you would not run into this issue even w/o the role service installed..