Click here to Skip to main content
16,012,508 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Good Day Guys. Hello there Programmers and developer.

Im having a problem with the class and im very confuse because i formatted it the way i formatted the first codes.

I have my MembershipProvider class here look like this:
Namespace AccessProvider
    Public Class AccessMembershipProvider
        Inherits MembershipProvider
        Private _sqlConn As SqlConnection
        Private _connString As String


and for my RoleProvider Class:
Namespace AccessProvider
   
    Public MustInherit Class AccessRoleProvider
        Inherits RoleProvider
        Private _sqlConn As SqlConnection
        Private _connString As String


and im getting the error in the web.config file
<membership defaultProvider="AccessMembershipProvider">
     <providers>
       <clear/>
       <add name="MembershipProvider" type="AccessProvider.MembershipProvider" connectionStringName="TrainingPlanConnectionString"/>
     </providers>
   </membership>
   <roleManager enabled="true" defaultProvider="AccessRoleProvider">
     <providers>
       <clear/>
       <add name="RoleProvider" type="AccessProvider.RoleProvider" connectionStringName="TrainingPlanConnectionString"/>
     </providers>
   </roleManager>


The membership provider is good to go but when i run it I got the error

"Parser Error Message: Could not load type 'AccessProvider.RoleProvider'."

Source Error: 


Line 108:       <providers>
Line 109:         <clear/>
Line 110:         <add name="RoleProvider" type="AccessProvider.RoleProvider"   
                        connectionStringName="TrainingPlanConnectionString"/>
Line 111:       </providers>
Line 112:     </roleManager>


Thank you for your help. Im looking forward to your answers. Any help will be much appreciated. thank you so much in advance. have a great day forward. :)
Posted

1 solution

In web.config, you need to rewrite add tag of providers as

HTML
<add name="PROVIDER NAME">
     type="PROJECT_NAME.CLASS_NAME, ASSEMBLY_NAME"/></add>


So, your error code need to be rewritten as,

HTML
Line 108:       <providers>
Line 109:         <clear />
Line 110:         <add name="RoleProvider">
                        type="AccessProvider.RoleProvider, ASSEMBLY_NAME"   
                        connectionStringName="TrainingPlanConnectionString"/>
Line 111:       </add></providers>
Line 112:     
 
Share this answer
 
Comments
Ariel Riyo 26-Feb-12 19:40pm    
thank you for your answer but its stil error.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900