Firebird 嵌入式服务器未在 ASP.NET MVC 3 项目中加载(无法加载 DLL“fbembed”)

发布于 2024-12-05 18:09:20 字数 2173 浏览 3 评论 0原文

在 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>

连接字符串如下所示(数据库不存在,应从实体框架生成):

<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)

出了什么问题?这应该有效!

提前致谢

编辑 在输出窗口中,我注意到以下消息(这让我很困惑):

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

In an ASP.NET MVC project (using Entity Framework 4.1 code first approach) i added a reference to C:\Program Files\FirebirdClient\FirebirdSql.Data.FirebirdClient.dll.

The configuration in Web.config looks as follows:

<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>

The connection string looks like this (database is non existend, should be generated from Entity Framework):

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

Added all the needed files (firebird.msg, icu*30.dll) to the bin folder, added also the folders intl and udf.

Renamed the fbembed.dll to fbclient.dll.

At runtime i get the following error:
Unable to load DLL 'fbembed': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

What is going wrong? This should work!

Thanks in advance

EDIT
In the output window i noticed the following messages (which confuses me a lot):

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

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

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

发布评论

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

评论(2

就像说晚安 2024-12-12 18:09:20

您不应将 fbembed.dll 重命名为 fbclient.dll。但您也可以在连接字符串中使用 ClientLibrary(检查 FbConnectionStringBuilder 类)参数来指定名称(和路径)。

You should not rename fbembed.dll to fbclient.dll. But you can also use ClientLibrary (check FbConnectionStringBuilder class) paramenter in connection string to specify the name (and path).

梦途 2024-12-12 18:09:20

使用“ClientLibrary”示例在连接字符串中定义 fbembed.dll 的路径

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

Define the Path to your fbembed.dll in your connectionstring with "ClientLibrary"

Sample:

<add name="myconn" connectionString="User=SYSDBA;Password=masterkey;Dialect=3;Database=|DataDirectory|mydatafile.fdb;ServerType=1;ClientLibrary=AbsolutePathToDll\fbembed.dll" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文