문제

Here is my class declaration:

public class XmlMembershipProvider : MembershipProvider
    {....}

and my web.config snipit:

<membership defaultProvider="CustomXmlMembershipProvider">
            <providers>
        <add name ="CustomXmlMembershipProvider" type="XmlMembershipProvider" xmlFilePath="App_Data\Userstore.xml"/> .....

I am not sure what to do from this point. I have done a ton of google searching but cannot find out why I am getting the following error:

Parser Error Message: Could not load type 'XmlMembershipProvider'.
도움이 되었습니까?

해결책

The type string should also include the assembly name that contains the XmlMembershipProvider.

 <add name="..." type="XmlMembershipprovider, MyAssembly" .../>

다른 팁

Only adding the reference to the assembly (as below) still gave errors, although it is a step in the right direction:

<add name="..." type="XmlMembershipprovider, MyAssembly" .../>

I found that the fully qualified reference to the assembly should ALSO be added as follows:

<add name="..." type="MyAssembly.XmlMembershipprovider, MyAssembly" .../>

Now it works.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top