【问题标题】:Firebird embedded server not loading in ASP.NET MVC 3 project (Unable to load DLL 'fbembed')Firebird 嵌入式服务器未在 ASP.NET MVC 3 项目中加载(无法加载 DLL 'fbembed')
【发布时间】:2011-09-20 21:25:36
【问题描述】:

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

【问题讨论】:

  • 只是一个想法,在 32 位 dll 的 x64 机器上运行?
  • @Giedrius:我的环境是Win Vista Home Premium Edition (32bit)

标签: asp.net-mvc firebird firebird-embedded


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

    示例:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-25
      • 1970-01-01
      • 2017-05-16
      • 2013-06-24
      • 2021-09-07
      • 2019-01-03
      • 1970-01-01
      • 2022-01-04
      相关资源
      最近更新 更多