asp.net - Error in web.config with membership AD provider -


try this:

<configuration>   <connectionstrings>     <add name="adservice" connectionstring="ldap://mossdc02/, dc=expgroup, dc=ru" />   </connectionstrings>     <system.web>         <membership defaultprovider="aspnetactivedirectorymembershipprovider">           <providers>             <add name="aspnetactivedirectorymembershipprovider"               type="system.web.security.activedirectorymembershipprovider,                system.web, version=2.0.3600, culture=neutral,                publickeytoken=b03f5f7f11d50a3a"               connectionstringname="adservice"               connectionusername="domain\\username"               connectionpassword="password"/>           </providers>         </membership>         <compilation debug="true" targetframework="4.0"/>         <httpruntime/>         <authentication mode="windows" />       </system.web> </configuration> 

in .cs file fire this:

protected void login1_authenticate(object sender, authenticateeventargs e) {             string username = "domain\\username";             string password = "password";              if (membership.providers["aspnetactivedirectorymembershipprovider"].validateuser(username, password)) {                 e.authenticated = true;             }         } 

have error:

description: error occurred during processing of configuration file required service request. please review specific error details below , modify configuration file appropriately.

parser error message: not load file or assembly 'system.web, version=2.0.3600, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. system cannot find file specified.

source error:

line 12: line 13: type="system.web.security.activedirectorymembershipprovider, line 15: system.web, version=2.0.3600, culture=neutral, line 16:
publickeytoken=b03f5f7f11d50a3a"

help please.)

you should not create own activedirectorymembershipprovider, shall config web.config regarding activedirectorymembershipprovider.

<membership defaultprovider="myadmembershipprovider">   <providers>     <add        name="myadmembershipprovider"        type="system.web.security.activedirectorymembershipprovider, system.web, version=2.0.0.0,               culture=neutral, publickeytoken=b03f5f7f11d50a3a"        connectionstringname="adconnectionstring"        connectionusername="testdomain\administrator"         connectionpassword="password"/>   </providers>  </membership> 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -