部署 SQLite 时出错 +实体框架 C# 应用程序。 [复制已确认。]

发布于 2024-10-03 13:19:28 字数 783 浏览 0 评论 0原文

这是我们在无法运行的计算机上运行应用程序时收到的错误:

System.ArgumentException: 指定的商店提供商不能 在配置中找到,或者没有 有效的。 --->系统参数异常: 无法找到请求的.Net 框架数据提供者。可能不是 已安装。

我们设法缩小了错误原因的范围,并且相当确定就是这个原因。我的开发机器上安装了 Visual Studio 2010。当我在安装结束时安装 ADO.Net SQLite 提供程序 (http://sourceforge.net/projects/sqlite-dotnet2/) 时,它会询问我使用什么 Visual Studio 来安装它。我选择了 Visual Studio 2010 并且它可以工作。安装我创建的安装包让我可以使用该应用程序,一切正常。

在我同事的机器上,我们做了同样的过程。首先安装应用程序而不安装数据提供程序(上面链接),我们收到了该错误。然后我们安装了数据提供程序,在安装向导结束时选择了 Visual Studio 2010,安装的应用程序现在可以运行了。

现在,在全新的 Windows XP 虚拟机上,我们尝试安装该应用程序并运行该应用程序,但出现了相同的错误。然后我们安装了数据提供程序,但它没有提示我们选择 Visual Studio,因为它没有安装,为什么客户端需要它,对吗?我们尝试在安装后运行已安装的应用程序,但出现相同的错误,就好像驱动程序尚未安装一样。

有什么建议吗?我到底需要客户拥有什么?似乎选择 Visual Studio 可以解决这个问题,所以也许该选项正在安装我们没有看到的东西?

Here's the error we receive when running the application on a machine that doesn't work:

System.ArgumentException: The
specified store provider cannot be
found in the configuration, or is not
valid. ---> System.ArgumentException:
Unable to find the requested .Net
Framework Data Provider. It may not be
installed.

We managed to narrow down the error cause and we're fairly certain this is it. On my dev machine I have Visual Studio 2010 installed. When I installed the ADO.Net SQLite provider (http://sourceforge.net/projects/sqlite-dotnet2/) at the end of the installation it asks me what Visual Studio to install it with. I selected Visual Studio 2010 and it work. Installing the setup package I created lets me use the application and everything is ok.

On my coworkers machine, we did the same process. First install the application without installing the data provider (linked above) and we got that error. Then we installed the data provider, selected Visual Studio 2010 at the end of the installation wizard and the installed application now works.

Now on a completely new Windows XP virtual machine, we try to install the application and run the application and we get the same error. Then we install the data provider, but it doesn't prompt us to select a Visual Studio because it doesn't have it installed, why would a client need it, right? We try to run the installed application after it installs and we get the SAME error, as if the driver isn't even installed.

Any suggestion? What exactly do I need the clients to have? It seems selecting a Visual Studio solves this problem, so maybe that option is installing something we're not seeing?

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

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

发布评论

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

评论(3

并安 2024-10-10 13:19:29

编辑 exe 的 app.config 以包含:

<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"/>
    </DbProviderFactories>
</system.data>

Edit your exe's app.config to include:

<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"/>
    </DbProviderFactories>
</system.data>
∞梦里开花 2024-10-10 13:19:29

在 Vanilla XP 或 Win7 系统上,我需要按照 Sqlite.NET 帮助中所述修改上述配置文件才能运行。

现在我已经添加了它,该程序不再在我的开发盒(VS2010)上运行,除非我将其取出。

顺便说一句,我在实体框架应用程序中使用 SQLite.NET。

On Vanilla XP or Win7 systems I needed the above config file modification, as described in Sqlite.NET help, in order to run.

Now that I've added it, the program does not run on my Dev box (VS2010) anymore unless I take it back out.

BTW I'm using SQLite.NET in an Entity Framework application.

甜点 2024-10-10 13:19:29

尝试过将 System.Data.SQLite.dll 放在 .exe 旁边吗?

Tried having the System.Data.SQLite.dll sitting next to the .exe?

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