I have written a custom role provider for my webapp. I have included proper arguments in my webconfig... however when I navigate to my site i am getting some sorta funny error.
included: Error Output, Relevant web.config snippet.
Error:
Parser Error Message: Object reference not set to an instance of an
object.
Source Error:
Line 79: <add Line 80: name="myroleprovider" Line 81: type="aarons.Mine.MyRoleProvider" Line 82: applicationName="MyRoleProvider" Line 83: connectionStringName="MySqlConnection" |
Web.config
<roleManager defaultProvider="myroleprovider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".ASPROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="All">
<providers>
<clear />
<add
name="myroleprovider"
type="aarons.Mine.MyRoleProvider"
applicationName="MyRoleProvider"
connectionStringName="MySqlConnection"
writeExceptionsToEventLog="false" />
</providers>
</roleManager>
<membership defaultProvider="mymembershipprovider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add
name="mymembershipprovider"
type="MyMembershipProvider"
connectionStringName="MySqlConnection"
passwordFormat="Hashed" />
</providers>
</membership>
MyRoleProvider.cs - sits inside the app_code dir alongside my membership provider.. when role provider is sert to false everything works smoothly.
namespace aarons.Mine
{
public sealed class MyRoleProvider : RoleProvider
{
private string eventSource = "MyRoleProvider"; //Application Name
private string eventLog = "Application"; //Log Title
private string exceptionMessage = "An exception occurred. Please check the Event Log."; //General Exception msg
private ConnectionStringSettings pConnectionStringSettings; //The connection String settings
private string connectionString;//self explanatory
private bool pWriteExceptionsToEventLog = false;
public bool WriteExceptionsToEventLog
**************************************************************
That should be enough info to help me out. If not I will add more as needed. Dont know why im getting such an error! grr :Confused:
Sincerest,
Aaron
"This lion is not a cub anymore..I've got a full grown mane. :RAWWWWWR!:" - me