我正在开发一个asp.net mvc-5 Web应用程序。现在在登录视图中,当用户单击“提交”时,将引发以下异常: -
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.
现在我提交了
connectionStringName="LocalMySqlServer" applicationName="/" />-->
</providers>
来自此位置下的machine.config文件: -
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config
但它没有解决问题,有人可以请这个吗? 感谢
修改
这是整个web.config文件: -
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<membership>
<providers>
<add name="TestDomain1ADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=4.0.0.0, 
 Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="DomainConnectionString" connectionUsername="Tgroup\administrator" connectionPassword="******" attributeMapUsername="sAMAccountName"/>
</providers>
</membership>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880"/>
</authentication>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<connectionStrings>
<add name="DomainConnectionString" connectionString="LDAP://WIN-SPDev.Tgroup.local/OU=Domain Controllers,DC=Tgroup,DC=local"/>
</connectionStrings>
</configuration>
以下是完整的错误: -
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 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.
Source Error:
Line 249: <providers>
Line 250: <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
Line 251: <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Clear" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
Line 252: </providers>
Line 253: </membership>
答案 0 :(得分:1)
您的项目有哪些参考?即使您没有直接引用MySql,也可能是您对一个依赖于特定版本的MySql的程序集的引用。
答案 1 :(得分:0)
您在项目中引用了哪些程序集?如果您没有使用MySQL库,则可以将其删除。如果要保留引用,请确保已添加正确的库版本。
答案 2 :(得分:0)
检查您的web.config文件。可能有人提到它在某处漂浮在那里。