You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

.NET 8.0(x64)下Embedded Firebird连接失败求助

.NET 8.0连接Firebird嵌入式数据库的问题

我正在尝试用.NET 8.0应用连接Firebird嵌入式数据库,服务器模式下使用以下连接字符串可正常连接现有数据库:

datasource=localhost;database=C:/Db/Test/MyDB.FDB;user id=SYSDBA;password=pwd;port number=3050;dialect=3;pooling=True;server type=0;character set=UTF8;connection lifetime=15;min pool size=0;max pool size=50;packet size=8192;wire crypt=Enabled;client library=fbclient.dll

随后我将server type从0改为1,并通过以下代码额外配置切换至嵌入式模式:

FbConnectionStringBuilder conn = new FbConnectionStringBuilder(_connectionStr);
// 确保使用嵌入式模式
conn.ServerType = FbServerType.Embedded;
// 测试连接 - 嵌入式模式下不应设置DataSource和密码
if (conn.ServerType == FbServerType.Embedded) {
    conn.ClientLibrary = "fbclient.dll";
    conn.DataSource = "";
    conn.UserID = "SYSDBA";
    conn.Password = "";
}
else {
    conn.ClientLibrary = "fbclient.dll";
    conn.WireCrypt = FbWireCrypt.Enabled;
}
try {
    using (FbConnection db = new FbConnection(conn.ConnectionString)) {
        db.Open();
        db.Close();
}

遇到的错误

  • 当本地Firebird服务运行时,报错:

Your user name and password are not defined. Ask your database administrator to set up a Firebird login

  • 停止服务后,已确保添加所有必要文件,但仍报错:

Unable to complete network request to host "xnet://Global\FIREBIRD".'

已尝试的排查操作

  • 确认程序与dll位数一致(尝试过AnyCPU和x64,使用x64文件)
  • 启用了旧版认证模式

请问在.NET 8.0中是否能正常使用Embedded Firebird模式?

内容的提问来源于stack exchange,提问作者neggenbe

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.24 01:26:05