Встроенный сервер Firebird не загружается в проекте ASP.NET MVC 3 (невозможно загрузить DLL 'fbembed') - PullRequest
0 голосов
/ 21 сентября 2011

В проекте ASP.NET MVC (с использованием подхода Entity Framework 4.1 вначале кода) я добавил ссылку на C: \ Program Files \ FirebirdClient \ FirebirdSql.Data.FirebirdClient.dll.

Конфигурация в Web.config выглядит следующим образом:

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

Строка подключения выглядит следующим образом (база данных не существует, должна генерироваться из Entity Framework):

<add name="AdvertiserDatabase"
      connectionString="ServerType=1;User=SYSDBA;Password=masterkey;Dialect=3;Database=|DataDirectory|AdvertiserDb.fdb"
      providerName="FirebirdSql.Data.FirebirdClient"/>

Добавлены все необходимые файлы (firebird.msg, icu * 30.dll) в папку bin , добавлены также папки intl и udf.

Переименовано в fbembed.dll в fbclient.dll.

Во время выполнения я получаю следующую ошибку: Невозможно загрузить DLL 'fbembed': указанный модуль не найден. (Исключение из HRESULT: 0x8007007E)

Что не так? Это должно работать!

Заранее спасибо

EDIT В окне вывода я заметил следующие сообщения (что меня очень смущает):

WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'FB_965910463.dll'
A first chance exception of type 'System.DllNotFoundException' occurred in FB_965910463.dll
A first chance exception of type 'System.DllNotFoundException' occurred in FirebirdSql.Data.FirebirdClient.dll
A first chance exception of type 'System.Data.ProviderIncompatibleException' occurred in System.Data.Entity.dll
A first chance exception of type 'System.Data.ProviderIncompatibleException' occurred in EntityFramework.dll
A first chance exception of type 'System.Data.ProviderIncompatibleException' occurred in System.Web.Mvc.dll
A first chance exception of type 'System.Data.ProviderIncompatibleException' occurred in System.Web.Mvc.dll
A first chance exception of type 'System.NotSupportedException' occurred in mscorlib.dll
A first chance exception of type 'System.NotSupportedException' occurred in mscorlib.dll

Ответы [ 2 ]

1 голос
/ 04 января 2012

Не следует переименовывать fbembed.dll в fbclient.dll. Но вы также можете использовать параметр ClientLibrary (проверьте класс FbConnectionStringBuilder) в строке подключения, чтобы указать имя (и путь).

0 голосов
/ 11 сентября 2015

Определите путь к файлу fbembed.dll в строке подключения с помощью «ClientLibrary»

Пример:

<add name="myconn" connectionString="User=SYSDBA;Password=masterkey;Dialect=3;Database=|DataDirectory|mydatafile.fdb;ServerType=1;ClientLibrary=AbsolutePathToDll\fbembed.dll" />
...