Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3595914
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:54:55+00:00 2026-05-18T19:54:55+00:00

This stack trace comes as a result of an error that reads Provider name

  • 0

This stack trace comes as a result of an error that reads “Provider name cannot be null or empty.
“

[ArgumentException: Provider name cannot be null or empty.]
System.Web.Security.Roles.Initialize() +2230205
System.Web.Security.RoleManagerModule.OnLeave(Object source, EventArgs eventArgs) +68
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Essentially I am creating my own custom role provider that inherits the SqlRoleProvider class, i’m calling initialize successfully and have confirmed that it sucessfully does everything in my code but something in .Net is clearly not being initialized right as the “Roles” object that I can’t inherit is causing me some headaches …

any ideas?

Ok my solution is layered which means i need to provide security through the business object layer too … in order to do that I define the following:

— EDIT 1 —

My Code:

In main assembly:

public class C20RoleProvider : RoleProvider
{
     private C20SqlRoleDataProvider prov;

     C20RoleProvider()
     {
         // this code is actually using some reflection based on config files
         // i have simplified this to illustrate the problem im having ...
         prov = new C20SqlRoleDataProvider();
     }

     public override void Initialize(string name, NameValueCollection config)
     {
         prov.Initialize(name, config);
     }
}

In provider assembly:

public class C20SqlRoleDataProvider : SqlRoleProvider
{
      // code omitted
}

At this point I would expect to be able to use anything that the base class “RoleProvider” defines by making the calls on prov. …

I have omitted the extra code but there is basically all the methods that are marked abstract from the RoleProvider class in the class “C20RoleProvider”.

I know it looks a bit wierd but what im looking to do is separate business logic from data aquisition in the provider, with the data provider being anything (through my reflection code) the business logic class “C20RoleProvider” can be use in the business framework without fear of breaking anything and allow for replacement back end sources (e.g. role data can come from anywhere).

There’s a lot more going on here but essentially the entire application framework / business object layer uses providers in this fashion to “provide” data to core business logic from any source.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T19:54:55+00:00Added an answer on May 18, 2026 at 7:54 pm

    Ok i did some digging … turns out that I wasn’t passing back that “Name” property which is not actually referred to anywhere …

    The fix goes something like this …

    public class C20RoleProvider : RoleProvider 
    { 
         private C20SqlRoleDataProvider prov; 
    
         public string Name
         {
             get {return prov.Name;}
         }
    
         C20RoleProvider() 
         { 
             // this code is actually using some reflection based on config files 
             // i have simplified this to illustrate the problem im having ... 
             prov = new C20SqlRoleDataProvider(); 
         } 
    
         public override void Initialize(string name, NameValueCollection config) 
         { 
             prov.Initialize(name, config); 
         } 
    } 
    

    Weird that this doesn’t seem to be known anywhere on the net.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.