成员自定义提供程序在web.config中失败调用

时间:2012-11-21 15:40:06

标签: c# asp.net custom-membershipprovider

大家好,这是我的app config

   <membership
 defaultProvider="TheTWMembershipProvider" userIsOnlineTimeWindow="20">
      <providers>
        <clear/>
        <add name="TheTWMembershipProvider"
            type="Model.TWMembershipProvider, Model"/>
      </providers>
    </membership>

这是我尝试登录时遇到的错误

Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Exception has been thrown by the target of an invocation.

Source Error: 





Line 99:         <clear/>
Line 100:        <add name="TheTWMembershipProvider"
Line 101:            type="Model.TWMembershipProvider, Model"/>
Line 102:      </providers>
Line 103:    </membership> 

我使用自定义提供程序命名为Model.Dll 命名 班TWMembershipProvider : System.Web.Security.MembershipProvider

我恭维

 public override bool ValidateUser(string username, string password)
    {
        return true;
    }

请帮忙!

1 个答案:

答案 0 :(得分:4)

错误消息表明调用成员资格提供程序的构造函数(实例或静态)时出错。请记住,字段初始值设定项是构造函数的一部分!

您应该有一个内部异常,其中包含更多详细信息。