1

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.

Craig
  • 381
  • 5
  • 22

2 Answers2

0

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

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

competent_tech
  • 44,465
  • 11
  • 90
  • 113
  • I have tried this and it is not the solution. I have also looked at how other paths were used within the registry and they all use single backslash. Your input is appreciated. – Craig Nov 19 '11 at 08:00
  • When I install Firebird the first time this was my problem, when I change the sigle to double backslash all works :D – UltimateVenom Nov 19 '11 at 17:16
0

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.

Farawin
  • 1,375
  • 2
  • 14
  • 19
  • Thank you!!! I have spent a long time looking for an answer and this worked a charm. I believe that my error was in the misreading the DDEX installation instructions. This works for .NET 4.0, but using 3.5, I change the runtime version to 2.0.0.0 as per the DDEX instructions and it still fails, however, I think I can live with this. – Craig Dec 06 '11 at 05:24
  • The firebird client will only work with .NET 4.0, is this something to do with the different versions of the GAC, as I have only installed the firebird library to the .NET 4.0 GAC and not the previous GAC, which incidentally, I can't get to run, something to do with it being a previous version. – Craig Dec 06 '11 at 06:03
  • AFAIK the 4.0 version will not run in 3.5 mode since it's compiled in 4.0. Also I think that for 3.5 you should use version 3.5.0.0. btw please mark this as the accepted answer if it solved your problem. Thanks. – Farawin Dec 13 '11 at 08:08