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 ...
是否有任何想法?
• 我的解决办法是分层的,这意味着我需要通过商业目标层提供安全保障......这样我就界定如下:
------
我的法典:
主要会议:
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);
}
}
在供应商大会上:
public class C20SqlRoleDataProvider : SqlRoleProvider
{
// code omitted
}
现在,我期望能够利用“供应商”这一基类通过发出呼吁来界定的任何东西。 ......
我删除了该外法,但基本上所有从“C20RoleProvider”类“角色提供人”类别中标明的抽象方法。
我知道,它看上去是比喻的,但什么看上去做是将业务逻辑与供应商的数据分开的,数据提供者是任何东西(通过我的思考法),在商业框架中可以使用“C20RoleProvider”这一商业逻辑类别,而不必担心会破坏任何东西,并允许替换后端来源(例如,作用数据可以来自任何地方)。
这里的情况更多,但基本上整个应用框架/商业目标层以这种方式利用供应商从任何来源向核心业务逻辑提供“提供”数据。