简体   繁体   English

具有不变名称“System.Data.SQLite.EF6”的 ADO.Net 提供程序未在机器或应用程序配置文件中注册

[英]The ADO.Net provider with Invariant name 'System.Data.SQLite.EF6' is not registered in the machine or application config file

So I've been struggling to try and get this resolved for a week or so now.所以我一直在努力尝试解决这个问题一个星期左右。 When I attempt to run my application on another computer other than my development machine, I get the following error:当我尝试在我的开发机器以外的另一台计算机上运行我的应用程序时,我收到以下错误:

Schema specified is not valid.指定的架构无效。 Errors: EntityFramework.RemManagerDBModel.ssdl(2,79): error 0175: The ADO.Net provider with invariant name 'System.Data.SQLite.EF6' is either not registered in the machine or application config file, or could not be loaded.错误:EntityFramework.RemManagerDBModel.ssdl(2,79):错误 0175:具有不变名称“System.Data.SQLite.EF6”的 ADO.Net 提供程序未在机器或应用程序配置文件中注册,或者无法加载. See the inner exception for details.有关详细信息,请参阅内部异常。

I attempted to retrieve the inner exception using this method, but to no avail.我尝试使用方法检索内部异常,但无济于事。 I'm not sure why it seems to think there is an inner exception, when in fact there isn't?我不确定为什么它似乎认为有一个内部异常,而实际上没有?

With regard to attempting to fix the issue myself, I have tried (I believe) all of the relevant possible solutions that are found under this SO question.关于尝试自己解决问题,我已经尝试(我相信)在这个SO question 下找到的所有相关可能的解决方案。

Currently my app.config looks something along the lines of what is shown below.目前我的 app.config 看起来类似于下面显示的内容。 An example of the connection string that is created is also included.还包括一个创建的连接字符串的示例。 The application uses Entity Framework 6 from a database first configuration.该应用程序使用来自数据库优先配置的 Entity Framework 6。 The entity model and diagram have been newly generated from the database file.实体模型和图表是从数据库文件中新生成的。 I am able to open the entity diagram with no problems and regenerating it via the "run custom tool" option hasn't made any difference.我能够毫无问题地打开实体图,并通过“运行自定义工具”选项重新生成它并没有任何区别。 The issue only seems to be present if I try to run the installed application on another computer.只有当我尝试在另一台计算机上运行已安装的应用程序时,才会出现此问题。 In this case, the computer is a totally clean (factory restored) version of Windows 10.在这种情况下,计算机是完全干净(出厂恢复)的 Windows 10 版本。

If any more information is required, I can add it in as necessary.如果需要更多信息,我可以根据需要添加。

App.config file: App.config 文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="RemManager.Forms.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <connectionStrings>
    <!-- See Datasource.ConnectionController for the connection string builder.-->
  </connectionStrings>
  <entityFramework>
    <providers>
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.106.0, Culture=neutral" />
      <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.106.0, Culture=neutral" />
    </providers>
  </entityFramework>
  <system.web>
    <membership defaultProvider="ClientAuthenticationMembershipProvider">
      <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
      </providers>
    </membership>
    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
      <providers>
        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
      </providers>
    </roleManager>
  </system.web>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite.EF6" />
      <add name="SQLite Data Provider"
           invariant="System.Data.SQLite"
           description="Data Provider for SQLite"
           type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
      <add name="SQLite Data Provider (Entity Framework 6)"
           invariant="System.Data.SQLite.EF6"
           description=".NET Framework Data Provider for SQLite (Entity Framework 6)"
           type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
    </DbProviderFactories>
  </system.data>
</configuration>

Example Connection String:连接字符串示例:

metadata=res://*/EntityFramework.RemManagerDBModel.csdl|res://*/EntityFramework.RemManagerDBModel.ssdl|res://*/EntityFramework.RemManagerDBModel.msl;provider=System.Data.SQLite.EF6;provider connection string="data source=C:\Users\MacbookPro\AppData\Roaming\RemManager\Datasource\RemManagerDB.db;default timeout=5000;failifmissing=True;read only=False;version=3"

I found the fix here: SQL DDEX for EF6 as I had installed VS into a new laptop.我在这里找到了修复: EF6 的 SQL DDEX,因为我已将 VS 安装到新笔记本电脑中。

steps:脚步:

  • Install latest SQLCEToolbox (this is a .vsix add-on to be able to open SQLite DB within VS IDE).安装最新的SQLCEToolbox (这是一个 .vsix 插件,能够在 VS IDE 中打开 SQLite DB)。 Follow the installer prompts, it may need to stop tasks you need to click "End Task" to continue the install按照安装程序提示,可能需要停止任务需要点击“结束任务”继续安装
  • Install SQLite in GAC (note: x86 not x64) Once per machine.在 GAC 中安装SQLite (注意:x86 不是 x64)每台机器一次。 Download the latest sqlite-netFx46-setup-bundle-x86-2015-1.0.xxx.0.exe (from https://system.data.sqlite.org/index.html/doc/trunk/www/downloads-unsup.wiki ) Select all checkbox: "Full Installation", Install the assemblies into the global assembly cache and Install VS designer components下载最新的 sqlite-netFx46-setup-bundle-x86-2015-1.0.xxx.0.exe(来自https://system.data.sqlite.org/index.html/doc/trunk/www/downloads-unsup.exe) wiki ) 选中所有复选框:“完全安装”,将程序集安装到全局程序集缓存中并安装 VS 设计器组件
  • Restart VS重启VS

to check: in VS main menu: Tools, there is a new entry SQLite/SQLServer compact toolbox.检查:在VS主菜单:工具中,有一个新条目SQLite/SQLServer compact toolbox。 Click on that and it will open a new tab where Solution Explorer is located near it.单击它,它将打开一个新选项卡,解决方案资源管理器位于它附近。 Click the About (question mark icon) and check both GAC and DDEX provider are "Yes"单击关于(问号图标)并检查 GAC 和 DDEX 提供程序是否为“是”

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误 - 无法加载具有不变名称“System.Data.SQLite.EF6”的ADO.NET提供程序 - Error - ADO.NET provider with invariant name 'System.Data.SQLite.EF6' could not be loaded 具有不变名称“MySql.Data.MySqlClient”的 ADO.NET 提供程序未在计算机或应用程序配置文件中注册 - The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file 错误175:具有不变名称“MySql.Data.MySqlClient”的ADO.NET提供程序未在计算机或应用程序配置文件中注册 - Error 175: The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file 具有不变名称“MySql.Data.MySqlClient”的 ADO.NET 提供程序未在机器或应用程序配置文件中注册 - The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registred in the machine or application config file 具有不变名称“System.Data.SqlClient”的 ADO.NET 提供程序未注册 - The ADO.NET provider with invariant name 'System.Data.SqlClient' is either not registered ADO.NET提供程序“Oracle.ManagedDataAccess.Client”未在计算机或应用程序配置文件中注册,或者无法加载 - The ADO.NET provider 'Oracle.ManagedDataAccess.Client' is either not registered in the machine or application config file, or could not be loaded System.InvalidOperationException:“没有为 ADO.NET 提供程序找到具有不变名称“System.Data.SQLite”的实体框架提供程序 - System.InvalidOperationException: 'No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SQLite' 没有为ADO.NET提供程序找到具有不变名称“System.Data.SqlClient”的实体框架提供程序。 - No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. 错误:找不到具有不变名称'System.Data.SqlClient'的ADO.NET提供程序的实体框架提供程序 - Error: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient' 错误175:不变名称为“ System.Data.SqlServerCe.4.0”的ADO.NET提供程序 - Error 175: The ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM