为什么 ADO.Net 实体数据模型设计器无法打开我的 EDMX 文件?

发布于 2024-12-09 01:41:16 字数 1266 浏览 0 评论 0原文

当尝试打开设计器 VS2010 时抱怨...... 无法加载“C:...\Model.edmx”:无法找到或加载已注册的 .Net Framework 数据提供程序。 现在的问题是,我之前已经创建了这个数据库第一个模型,并且代码成功运行并访问了数据库。我正在使用 SQLite v1.0.76.0,我已安装它并将其添加到我的参考文献中,并修改了我的 App.Config,如下所示,

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite"/>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.76.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/>
    </DbProviderFactories>
  </system.data>
  <connectionStrings>
    <add name="EDSEntities" connectionString="metadata=res://*/Model2.csdl|res://*/Model2.ssdl|res://*/Model2.msl;provider=System.Data.SQLite;provider connection string='data source=&quot;C:\EDS.db&quot;;foreign keys=true'" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>

我不知道问题可能是什么......有什么想法吗?

When trying to open the designer VS2010 complains that ...
Cannot load 'C:...\Model.edmx': Failed to find or load the registered .Net Framework Data Provider.
Now the thing is that I had previously created this database first model and the code successfully runs and does access the DataBase. I'm using SQLite v1.0.76.0 which I've installed and added to my References and have modified my App.Config as shown below

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite"/>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.76.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/>
    </DbProviderFactories>
  </system.data>
  <connectionStrings>
    <add name="EDSEntities" connectionString="metadata=res://*/Model2.csdl|res://*/Model2.ssdl|res://*/Model2.msl;provider=System.Data.SQLite;provider connection string='data source="C:\EDS.db";foreign keys=true'" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>

I am at a loss as to what the issue might be ... any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七颜 2024-12-16 01:41:16

重新安装 SQLite .Net Provider 解决了该问题。

Reinstalling the SQLite .Net Provider resolved the issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文