0

System Type: 64-bit OS, x64-based processor

Front End: MS Visual Studio 2010

Backend: Firebird database v2.5.0 64-bit Server type: Embedded type (NOTE: Standalone Server v2.5.0 is also present in my system) Firebird .NET Provider v2.5.0

NB: There are some special reasons why I'm using such old version of VS & Firebird database

Project Platform target: x64

When running my application, I get the error:

An attempt was made to load a program with an incorrect format (Exception from HRESULT:0x8007000B)

The above error is generated when in Add Connection-> TableAdapter Configuration wizard and Server type is Embedded, however there is no error when the server type is Standalone.

My app.config looks like:

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="dbConFirebirdSQL" connectionString="User=SYSDBA;Password=masterkey;Database=INSMANEMBED.fdb;DataSource=localhost;Port=3050;Dialect=3;Charset=NONE;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=1;"/>
  </connectionStrings>
  <system.data>
    <DbProviderFactories>
      <remove invariant="FirebirdSql.Data.FirebirdClient"/>
      <add name="FirebirdSql.Data.FirebirdClient" invariant="FirebirdSql.Data.FirebirdClient" description="Firebird Data Provider for .NET" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient, Culture=neutral, PublicKeyToken=3750abcc3150b00c" />
    </DbProviderFactories>
  </system.data>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

Some files present in bin\debug are

  • fbembed.dll
  • firebird.conf
  • firebird.msg
  • ib_util.dll
  • icudt30.dll
  • icuin30.dll
  • icuuc30.dll
  • msvcp80.dll
  • msvcr80.dll
  • Microsoft.VC80.CRT.manifest
  • intl

I searched the internet and there they are saying that such error may occur if there is difference of bitness of DLL. So using the command dumpbin /headers C:\path\name.dll, I began to check which DLL is 32-bit/64-bit. And at last I found the offending DLL. It's the FirebirdSql.Data.FirebirdClient which was 32-bit while the rest were 64-bit.

Now my problem is that I again searched the internet all over again for the 64-bit version of FirebirdSql.Data.FirebirdClient but could find none. All are of 32-bit.

Please advise what should I do now.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
gomesh munda
  • 838
  • 2
  • 14
  • 32
  • 1
    The `FirebirdSql.Data.FirebirdClient.dll` is a C# assembly compiled as AnyCPU, as a result, `dumpbin` shows the 'wrong' information. Instead you should check with `CorFlags`. Your problem is likely elsewhere. In any case, why are you using a 9 year old Firebird .net provider and a 8 year old Firebird version?! I can't think of a reason why you'd stick to 2.5.0, when 8 bugfix releases have been done since. Who knows, maybe you are running into a problem with either one that has long since been fixed. – Mark Rotteveel Jan 25 '18 at 08:59
  • In any case, if you think the problem is really 32 bit vs 64 bit, then instead use the Firebird 32 bit embedded zipkit instead of 64 bit, and see if that works. Or try compiling your application as AnyCPU. – Mark Rotteveel Jan 25 '18 at 09:00
  • @MarkRotteveel thanks for the reply.It still shows me the same error and i think you are right in telling that the problem lies elsewhere.I have been foolishly using outdated VS 2010 with Firebird to take advantage of the in-built Installer maker for deployment.Just as you suggested, now will try with the latest Visual Studio & Firebird and also maybe use either WixInstaller or Innosetup for the deployment. – gomesh munda Jan 25 '18 at 11:54
  • 1
    Even using Visual Studio 2010 doesn't keep you from using a newer Firebird version, nor a newer version of the Firebird.net provider (although you may run into some problems with the latest versions of the .net provider due to NuGet version issues). – Mark Rotteveel Jan 25 '18 at 12:13

0 Answers0