A
Alias
Hi -
I'm trying to implement a custom RoleProvider based on the SqlRoleProvider.
I keep receiving a an error that it can't load type
'MyRoleTest.MyRoleProvider' when trying to load my RoleProvider. However
this only occurs after deployment. On my local machine it works fine. So I
created the most basic role provider project I could think of. It is below:
Imports System.Web.Security
Imports System.Web.Configuration
Imports System.Configuration.Provider
Imports System.Collections.Specialized
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Diagnostics
Imports System.Web
Imports System.Globalization
Imports System.Text
Imports Microsoft.VisualBasic
Public Class MyRoleProvider
Inherits SqlRoleProvider
Public Overrides Sub Initialize(ByVal name As String, ByVal config As
System.Collections.Specialized.NameValueCollection)
MyBase.Initialize(name, config)
End Sub
End Class
Here is how I reference it in the web.config :
<roleManager enabled="true" defaultProvider="TheRoleProvider">
<providers>
<clear/>
<add name="TheRoleProvider" type="MyRoleTest.MyRoleProvider"
connectionStringName="dbConn" applicationName="TestApp"/>
</providers>
</roleManager>
Locally it runs fine, but once deployed on the server it errors out on the
<add...> line. I'm using the fully qualified type name and the DLL for the
project containing the provider is in the Bin folder.
The odd thing is that I did the exact same thing for the MembershipProvider,
inheriting from SqlMembershipProvider and referencing it the same way in the
web.config and it works without a hitch. I would apprecieate any ideas. I
did try adding the MyRoleProvider class to the Web App Project itself in the
App_Code folder but that gave the same error.
I'm trying to implement a custom RoleProvider based on the SqlRoleProvider.
I keep receiving a an error that it can't load type
'MyRoleTest.MyRoleProvider' when trying to load my RoleProvider. However
this only occurs after deployment. On my local machine it works fine. So I
created the most basic role provider project I could think of. It is below:
Imports System.Web.Security
Imports System.Web.Configuration
Imports System.Configuration.Provider
Imports System.Collections.Specialized
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Diagnostics
Imports System.Web
Imports System.Globalization
Imports System.Text
Imports Microsoft.VisualBasic
Public Class MyRoleProvider
Inherits SqlRoleProvider
Public Overrides Sub Initialize(ByVal name As String, ByVal config As
System.Collections.Specialized.NameValueCollection)
MyBase.Initialize(name, config)
End Sub
End Class
Here is how I reference it in the web.config :
<roleManager enabled="true" defaultProvider="TheRoleProvider">
<providers>
<clear/>
<add name="TheRoleProvider" type="MyRoleTest.MyRoleProvider"
connectionStringName="dbConn" applicationName="TestApp"/>
</providers>
</roleManager>
Locally it runs fine, but once deployed on the server it errors out on the
<add...> line. I'm using the fully qualified type name and the DLL for the
project containing the provider is in the Bin folder.
The odd thing is that I did the exact same thing for the MembershipProvider,
inheriting from SqlMembershipProvider and referencing it the same way in the
web.config and it works without a hitch. I would apprecieate any ideas. I
did try adding the MyRoleProvider class to the Web App Project itself in the
App_Code folder but that gave the same error.