火鸟与Visual Studio 2010 无法找到数据提供程序

发布于 2024-12-16 02:36:21 字数 3748 浏览 4 评论 0原文

我有 Windows 7 64 位。我尝试在 VS 2010 中使用 Firebird。

我收到以下错误:

无法找到或加载已注册的 .Net Framework 数据提供程序。

我已执行以下操作

  1. 已安装“NETProvider-2.6.5.msi” “
  2. 提取“FirebirdDDEXProvider-2.0.5.zip”

我将 .dll 从 DDEX zip 文件复制到该目录 C:\Program Files (x86)\FirebirdClient 其内容为:

FirebirdSql.Data.FirebirdClient.dll
FirebirdSql.Data.UnitTests.dll
FirebirdSql.VisualStudio.DataTools.dll
FirebirdSql.VisualStudio.DataToolsUI.dll

我编辑了 DDEX 中的 2 个 reg 文件,将“%path%”替换为“C:\Program Files ( x86)\FirebirdClient"

从目录 "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools" 我运行了 Gacutil,如下所示

cd "C:\Program Files (x86)\FirebirdClient"
"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil.exe" /i FirebirdSql.VisualStudio.DataTools.dll

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil.exe" /i FirebirdSql.Data.FirebirdClient.dll

我无法使用其他 Gacutil,因为它说它是为以前的版本构建的。

我还运行了

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil.exe" /l Firebirdsql.data.firebirdclient

这给了我:

The Global Assembly Cache contains the following assemblies:
Firebirdsql.data.firebirdclient, Version=2.6.5.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL

从目录 C:\Windows\Microsoft.NET 我修改了以下 4 个文件:

\Framework\v4.0.30319\Config\machine.config
\Framework\v2.0.50727\Config\machine.config

\Framework64\v2.0.50727\Config\machine.config
\Framework64\v4.0.30319\Config\machine.config

在每个文件中,我添加了以下 2 个条目

<configuration>
    <configSections>
        <section name="FirebirdSql.Data.FirebirdClient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.6.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </configSections>
</configuration>

<system.data>
    <DbProviderFactories>
       <add name="Firebird Client Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description=".Net Framework Data Provider for Firebird" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient, Version=2.6.5.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c" />
    </DbProviderFactories>
</system.data>

在完成所有这些之后,我仍然无法让 firebird 使用视觉工作室。我可以查看数据库&服务器资源管理器中的表,但是我无法添加数据源,在完成步骤中,它给出错误:

“创建新数据源时发生错误: 无法获取“WinFormsApp.DataSet1”的类型信息。

作为一个更好的示例,使用 DbProviderFactory,Firebird 是第 5 个索引,我运行以下代码:

try
   {
      DataTable dt = DbProviderFactories.GetFactoryClasses();
      // Use this for loop to see what row holds FirebirdClient
      for (int i = 0; i < dt.Rows.Count; i++)
          Console.WriteLine("{0}: {1}", i.ToString(), dt.Rows[i][2].ToString());

      // For me, FirebirdClient is at row 5
      DbProviderFactory dataFactory = DbProviderFactories.GetFactory(dt.Rows[5]);

出现以下异常:

无法找到或加载已注册的 .Net Framework 数据提供程序。

异常:

System.Configuration.ConfigurationErrorsException was caught
  Message=Failed to find or load the registered .Net Framework Data Provider.
  Source=System.Data
  BareMessage=Failed to find or load the registered .Net Framework Data Provider.
  Line=0
  StackTrace:
       at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
       at Forms.TestForm.TestConn() in C:\Data\Projects\Dev\FirebirdTest\Forms\TestForm.cs:line 113
  InnerException: null

任何人都可以请协助。

I have Windows 7 64bit. I am trying to use Firebird with VS 2010.

I get the following error:

Failed to find or load the registered .Net Framework Data Provider.

I have done the following

  1. Installed "NETProvider-2.6.5.msi"
  2. Extracted "FirebirdDDEXProvider-2.0.5.zip"

I copied the .dll's from the DDEX zip file to the directory
C:\Program Files (x86)\FirebirdClient The contents of which are:

FirebirdSql.Data.FirebirdClient.dll
FirebirdSql.Data.UnitTests.dll
FirebirdSql.VisualStudio.DataTools.dll
FirebirdSql.VisualStudio.DataToolsUI.dll

I edited the 2 reg files from the DDEX, replacing "%path%" with "C:\Program Files (x86)\FirebirdClient"

From the directory "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools" I have run the Gacutil, as follows

cd "C:\Program Files (x86)\FirebirdClient"
"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil.exe" /i FirebirdSql.VisualStudio.DataTools.dll

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil.exe" /i FirebirdSql.Data.FirebirdClient.dll

I could not use the other Gacutil, as it said it was built for a previous version.

I have also run

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\gacutil.exe" /l Firebirdsql.data.firebirdclient

Which gave me:

The Global Assembly Cache contains the following assemblies:
Firebirdsql.data.firebirdclient, Version=2.6.5.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL

From the directory
C:\Windows\Microsoft.NET I have modified the following 4 files:

\Framework\v4.0.30319\Config\machine.config
\Framework\v2.0.50727\Config\machine.config

\Framework64\v2.0.50727\Config\machine.config
\Framework64\v4.0.30319\Config\machine.config

In each of these files, I have added the following 2 entries

<configuration>
    <configSections>
        <section name="FirebirdSql.Data.FirebirdClient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.6.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </configSections>
</configuration>

<system.data>
    <DbProviderFactories>
       <add name="Firebird Client Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description=".Net Framework Data Provider for Firebird" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient, Version=2.6.5.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c" />
    </DbProviderFactories>
</system.data>

After all of this, I still can't get firebird working withing Visual studio. I can view the database & tables from within the Server explorer, however I can't add a datasource, at the finish step, it gives an error:

"An error occurred while creating the new data source:
Could not get type information for "WinFormsApp.DataSet1".

As a better example, Using the DbProviderFactory, Firebird is the 5th index, I run the following code:

try
   {
      DataTable dt = DbProviderFactories.GetFactoryClasses();
      // Use this for loop to see what row holds FirebirdClient
      for (int i = 0; i < dt.Rows.Count; i++)
          Console.WriteLine("{0}: {1}", i.ToString(), dt.Rows[i][2].ToString());

      // For me, FirebirdClient is at row 5
      DbProviderFactory dataFactory = DbProviderFactories.GetFactory(dt.Rows[5]);

The following exception appears:

Failed to find or load the registered .Net Framework Data Provider.

Exception:

System.Configuration.ConfigurationErrorsException was caught
  Message=Failed to find or load the registered .Net Framework Data Provider.
  Source=System.Data
  BareMessage=Failed to find or load the registered .Net Framework Data Provider.
  Line=0
  StackTrace:
       at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
       at Forms.TestForm.TestConn() in C:\Data\Projects\Dev\FirebirdTest\Forms\TestForm.cs:line 113
  InnerException: null

Can anyone please assist.

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

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

发布评论

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

评论(2

放飞的风筝 2024-12-23 02:36:21

machine.config 中的这一行:

<configSections>
    <section name="FirebirdSql.Data.FirebirdClient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.6.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>

应如下所示:

<configSections>
    <section name="firebirdsql.data.firebirdclient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>

请注意,版本不同,它应该是运行时版本,而不是 firebird 客户端的版本。另外,我相信您只需要编辑 machine.config 的 32 位版本,因为 VS 是一个 32 位应用程序。

This line in the machine.config:

<configSections>
    <section name="FirebirdSql.Data.FirebirdClient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.6.5.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>

should read like this:

<configSections>
    <section name="firebirdsql.data.firebirdclient" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>

Note that the version is different, it's supposed to be the runtime versin and not the version of the firebird client. Also I believe that you need only edit the 32bit version of the machine.config since VS is a 32 bit application.

绝不放开 2024-12-23 02:36:21

当您更改%path%时,您需要这样做:

C:\\Program Files (x86)\\FirebirdClient

When you change the %path%, you need to do it this way:

C:\\Program Files (x86)\\FirebirdClient

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