且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法加载类型'HDI.AspNet.Membership.HDIMembershipProvider'。

更新时间:2022-10-23 08:58:09

无法找到您的提供商...
 HDI.AspNet.Membership.HDIMembershipProvider 





这就是你应该写的。



如果你的提供者类文件在App_code文件夹中:

 type =   HDI.AspNet.Membership.HDIMembershipProvider 





否则,如果在单独的dll中:

 type =   Namespace.classname,assembly



汇编〜你的dll名字。



你也可以添加对你的dll的引用


Hii ,

Below is my web.config file section

<connectionStrings>
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-AutoSpareParts-20141021232459;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-AutoSpareParts-20141021232459.mdf" />
    <add name="AutoSparePartsConnection" providerName="System.Data.SqlClient" connectionString="Data Source=TORAKAMI\TORAKAMI;Initial Catalog=AutoSpareParts;Integrated Security=True" />
  </connectionStrings>




<membership defaultprovider="HDIMembershipProvider" userisonlinetimewindow="15">

<providers>
<clear>
<add>
name="HDIMembershipProvider"
type="HDI.AspNet.Membership.HDIMembershipProvider"
connectionStringName="AutoSparePartsConnection"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
writeExceptionsToEventLog="false" />



But i am getting Below eror

Server Error in '/' Application.
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: Could not load type 'HDI.AspNet.Membership.HDIMembershipProvider'.

Source Error:


Line 38: <add>
Line 39: name="HDIMembershipProvider"
Line 40: type="HDI.AspNet.Membership.HDIMembershipProvider"
Line 41: connectionStringName="AutoSparePartsConnection"
Line 42: enablePasswordRetrieval="true"

It is not able to find your provider ...
HDI.AspNet.Membership.HDIMembershipProvider



this is how you should write.

If your provider class file is in App_code folder :

type="HDI.AspNet.Membership.HDIMembershipProvider"



Else if in seperate dll then:

type="Namespace.classname, assembly".


assembly ~ your dll name.

also you add a reference to your dll