安装的MySQL Connector .NET后ASP.Net MVC4配置错误 [英] ASP.Net MVC4 configuration error after installing MySQL Connector .NET

查看:364
本文介绍了安装的MySQL Connector .NET后ASP.Net MVC4配置错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建project.When我使用的空项目,只是在浏览器中运行它,它的工作原理fine.But一个MVC4 Web应用程序的问题是,当我试图建立一个互联网应用项目,而不是空项目。一旦我创建互联网应用项目,并试图在浏览器中运行它时,它显示了以下配置error.As我理解它的下面是错误的东西与MySQL相关的连接器组件reference.Anyhow。

 在'/'应用程序的服务器错误。配置错误说明:该请求提供服务所需的配置文件的处理过程中发生错误。请检查下面的特定错误详细信息并适当地修改配置文件。分析器错误信息:未能加载文件或程序集MySql.Web.v20,版本= 6.9.4.0,文化=中性公钥= c5687fc88969c44d'或它的一个依赖。该系统找不到指定的文件。源错误:
265线:其中,供应商>
266线:其中,添加名称=AspNetSqlMembershipProviderTYPE =System.Web.Security.SqlMembershipProvider,System.Web程序,版本= 4.0.0.0,文化=中性公钥= b03f5f7f11d50a3a的connectionStringName =LocalSqlServer这个enablePasswordRetrieval =假 enablePasswordReset设置=真requiresQuestionAndAnswer =真的applicationName =/requiresUniqueEmail =假了passwordFormat =散列maxInvalidPasswordAttempts =5minRequiredPasswordLength =7minRequiredNonalphanumericCharacters =1passwordAttemptWindow =10passwordStrengthRegularEx pression =/>
267线:其中,添加名称=MySQLMembershipProviderTYPE =MySql.Web.Security.MySQLMembershipProvider,MySql.Web.v20,版本= 6.9.4.0,文化=中性公钥= c5687fc88969c44d的connectionStringName =LocalMySqlServerenablePasswordRetrieval =假enablePasswordReset设置=真requiresQuestionAndAnswer =真的applicationName =/requiresUniqueEmail =假了passwordFormat =清除maxInvalidPasswordAttempts =5minRequiredPasswordLength =7minRequiredNonalphanumericCharacters =1passwordAttemptWindow =10passwordStrengthRegularEx pression =/>
268线:LT; /供应商>
269​​线:LT; /会员>源文件:C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\ CONFIG \\ machine.config中线路:267程序集加载跟踪:下列信息有助于确定程序集MySql.Web.v20,版本= 6.9.4.0,文化=中性公钥= c5687fc88969c44d'无法加载。


解决方案

在安装MySQL .NET连接器6.9.4(可能是其它版本也是如此),因为如果你没有在安装过程中取消选中网络提供商,会出现此讨厌的错误它在你的machine.config中能带给你这个错误写道。请确保在应用任何步骤,以便从那里你必须开始启动前阅读一个完整的答案。

与其他建议的真正问题是,如果你不是在每个项目中使用MySQL只需添加到MySQL DLL的引用,以减轻每一个项目的问题不是一个选项。使用ASP.NET你的每一个项目都需要它,因为一排排机器配置安装程序添加的!

要妥善解决问题:


  1. 启动安装程序,然后单击更改

  2. 则完全删除了网络提供商部分。

  3. 这将删除您的Machine.config声明(我发现一个可怕的事情在安装程序做的,但安装程序没有任何通知创建它们反正)。

  4. 之后,它是检查你的机器配置,你可以在这里找到 一个好主意。并确保它没有破坏双方<一个href=\"http://stackoverflow.com/questions/6447936/updating-net-4-0-machine-config-seems-to-have-no-effect\">32和64机CONFIGS 的。

  5. 当你的机器配置是明确的MySql.Web组件添加到您的项目,并在项目的web.config添加MySQLMembershipProvider声明 - 标准程序

  6. 享受全新安装的MySQL连接器。

但是,如果你那样做您可以尝试之后添加阿土NET实体数据模型,对不对?如果是这样的情况下,最有可能是你没有看到MySQL的选项,在向导中可用的数据源。这是因为,从6.7版本,当你安装MySQL Connector .NET它将不再作为DDEX提供商自动。

要解决此问题,你必须从下载的这里或从这里直接刚刚Visual Studio集成插件。

确定检查的 Visual Studio集成的和的连接的在上述任一安装程序的安装向导中。

I'm creating a MVC4 web application project.When i'm using empty project and simply run it on browser it works fine.But the problem is when i'm trying to create a Internet application project instead of Empty project.Once i created internet application project and when trying to run it on browser it shows following configuration error.As i understood it's something related to MySQL connector assembly reference.Anyhow following is the error.

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.v20, Version=6.9.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.

Source Error: 


Line 265:      <providers>
Line 266:        <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 267:        <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web.v20, Version=6.9.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 268:      </providers>
Line 269:    </membership>

Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config    Line: 267 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'MySql.Web.v20, Version=6.9.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' could not be loaded.

解决方案

This nasty error occurs when you install MySQL .NET Connector 6.9.4 (probably other versions too) because if you do not uncheck "Web Providers" during the installation it writes in your machine.config which brings you to this error. Be sure to read the entire answer before applying any of these steps in order to start from where you have to start.

The real problem with other suggestions is that if you are not using MySQL in every project to just add a reference to MySQL dll to mitigate the problem in every project is not an option. Every project of yours that uses ASP.NET will require it because of the rows added in machine config by the installer!

To solve the problem properly :

  1. Start the installer and click "Change"
  2. then remove the "Web Providers" section entirely.
  3. This will remove the declarations from your machine.config (which I find a horrible thing to do in installer but the installer creates them without any notification anyway).
  4. After that it is a good idea to check you machine config which you can find here. And be sure that it did not spoil both 32 and 64 machine configs.
  5. When your machine config is clear add the MySql.Web assembly to your project and add the MySQLMembershipProvider declaration in your project web.config - the standard procedure.
  6. Enjoy the clean installation of MySQL connector.

But if you do it that way you may try to add Ado NET Entity Data model after, right? If that is the case it is most likely that you do not see the option for MySQL as an available data source in the wizard. This is because from version 6.7 when you install MySQL Connector .NET it will no longer register as DDEX provider automatically.

To correct this issue you have to download a separate installer provided especially for MySQL and .NET from here or the just Visual Studio integration plug-in directly from here.

Be sure to check the Visual Studio integration and connector during the installation wizard on either of the above installers.

这篇关于安装的MySQL Connector .NET后ASP.Net MVC4配置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆