ASP.net表单身份验证与MySQL
问题描述:
我正在用.NET 4.0编写一个网站,并使用MySQL 6.7.4.0, 我尝试使用MySql作为我的表单身份验证的成员资格提供程序。 我已将此添加会员节在我的web.config文件:ASP.net表单身份验证与MySQL
<add name="MySqlMembershipProvider"
type="MySql.Web.Security.MySQLMembershipProvider,
MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
autogenerateschema="true"
connectionStringName="LocalMySqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
applicationName="/"/>
当我去到asp.net网站管理工具,然后转到安全选项卡,我得到以下错误:
Could not load file or assembly 'MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
我已经将所有MySQL dll添加到了我的项目引用中,全部都在6.7.4.0版本中,并且它们的所有路径都是正确的。
什么问题?
答
我相信引用DLL会添加到您的项目中,并在您的GAC中注册一个不同版本的DLL。确保两者都是相同的版本。
也许你的项目引用了MySql.Web程序集,但是网站管理工具没有。将MySql.Web程序集注册到GAC中,然后再次尝试Site Amin Tool。 – jlvaquero