配置错误 - 无法识别的属性名称/无法找到所请求的.Net框架数据提供程序。它可能没有安装 [英] Configuration Error - Unrecognized attribute 'name' / Unable to find the requested .Net Framework Data Provider. It may not be installed

查看:194
本文介绍了配置错误 - 无法识别的属性名称/无法找到所请求的.Net框架数据提供程序。它可能没有安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在实时Web应用程序中尝试访问我的数据库时,我收到错误:


'/'应用程序中的服务器错误。 / p>

配置错误



说明:在处理
配置文件所需的服务期间发生错误这个请求。请查看下面的
具体错误详细信息,并适当修改您的配置文件



解析器错误消息:无法识别的属性name。



源错误:



服务器上发生应用程序错误。此应用程序的当前自定义错误
设置会阻止远程查看应用程序
错误的详细信息(出于安全原因)。但是,可以通过在本地服务器上运行的浏览器来查看



源文件:C:\home\site\wwwroot\\ \\web.config行:115


我的web配置位于第115行:

 < entityFramework> 
< defaultConnectionFactory type =System.Data.Entity.Infrastructure.LocalDbConnectionFactory,EntityFramework>
< parameters>
< parameter value =mssqllocaldb/>
< / parameters>
< / defaultConnectionFactory>
< providers>
< provider invariantName =System.Data.SqlClienttype =System.Data.Entity.SqlServer.SqlProviderServices,EntityFramework.SqlServer/>
< provider invariantName =MySql.Data.MySqlClienttype =MySql.Data.MySqlClient.MySqlProviderServices,MySql.Data.Entity.EF6,Version = 6.8.3.0,Culture = neutral,PublicKeyToken = c5687fc88969c44d> ;< /提供商GT;
< / providers>
< / entityFramework>
< system.data>
< DbProviderFactories>
< remove invariant =MySql.Data.MySqlClientname =MySQL数据提供者/> // Line:115
< add name =MySQL数据提供者invariant =MySql.Data.MySqlClientdescription =.Net Framework Data Provider for MySQLtype =MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,Version = 6.9.9.0,Culture = neutral,PublicKeyToken = c5687fc88969c44d/>
< add name =MySQL数据提供者invariant =MySql.Data.MySqlClientdescription =。用于MySQL的Net Framework数据提供者type =MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data,Version = 6.8.3.0,Culture = neutral,PublicKeyToken = c5687fc88969c44d/>< / DbProviderFactories>
< /system.data>

当我删除: name =MySQL数据提供者从该行,我只是得到另一个错误,并绕圈子。



此外,当我刷新页面,并删除名称 part I get:


无法找到所请求的.Net框架数据提供程序。它可能不会
安装。


任何帮助都非常感谢。

解决方案

8小时后,我设法解决了这个问题。由于某些原因,在NuGet软件包管理器中,我说我安装的版本是Version = 6.9.9.0,所以我补充说:

  ; add name =MySQL Data Providerinvariant =MySql.Data.MySqlClientdescription =.Net Framework Data Provider for MySQLtype =MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data,Version = 6.9.9.0, Culture = neutral,PublicKeyToken = c5687fc88969c44d/> 

到我的web.config,但它仍然没有工作,我尝试了一切,重新安装等然后最终我进入我的bin文件夹,实际版本有6.8.3.0,但NuGet显示6.9.9.0 - 奇怪!



我从bin文件夹,然后重新安装最新版本,一切正常!


When trying to access my database in a live web application I get 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: Unrecognized attribute 'name'.

Source Error:

An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Source File: C:\home\site\wwwroot\web.config Line: 115

My web config where line 115 is located:

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
  <parameters>
    <parameter value="mssqllocaldb" />
  </parameters>
</defaultConnectionFactory>
<providers>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
  <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
  <remove invariant="MySql.Data.MySqlClient" name="MySQL Data Provider" /> // Line: 115
  <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
  <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /></DbProviderFactories>
</system.data>

When I remove: name="MySQL Data Provider" from that line, I just get another error and go around in circles.

Also when I refresh the page and remove that name part I get:

Unable to find the requested .Net Framework Data Provider. It may not be installed.

Any help is greatly appreciated.

解决方案

After 8 hours I managed to solve this. For some reason, in NuGet Package Manager it said the version I had installed was Version=6.9.9.0 so I added:

<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />

to my web.config and yet it still didn't work, I tried everything, reinstalling, etc. etc. and then eventually I went into my bin folder and the actual version there was 6.8.3.0 yet NuGet displayed 6.9.9.0 - strange!

I deleted these from the bin folder and then reinstalled the latest version and it all worked!

这篇关于配置错误 - 无法识别的属性名称/无法找到所请求的.Net框架数据提供程序。它可能没有安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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