XML CUSOMTER FOURNISSION DE TYPE C #
-
14-11-2019 - |
Question
Voici ma déclaration de classe:
public class XmlMembershipProvider : MembershipProvider
{....}
et ma web.config snipit:
<membership defaultProvider="CustomXmlMembershipProvider">
<providers>
<add name ="CustomXmlMembershipProvider" type="XmlMembershipProvider" xmlFilePath="App_Data\Userstore.xml"/> .....
Je ne suis pas sûr de quoi faire de ce point.J'ai fait une tonne de recherche de Google mais ne peut pas savoir pourquoi je reçois l'erreur suivante:
Parser Error Message: Could not load type 'XmlMembershipProvider'.
La solution
The type string should also include the assembly name that contains the XmlMembershipProvider.
<add name="..." type="XmlMembershipprovider, MyAssembly" .../>
Autres conseils
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.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow