简体   繁体   English

Firebird ADO.NET 4.10.0.0数据提供程序是否适用于Firebird 3.0?

[英]Does Firebird ADO.NET 4.10.0.0 Data provider work with Firebird 3.0?

I'm currently trying to get my ASP.net 4.5 project connecting to the recently release Firebird 3.0. 我目前正在尝试将我的ASP.net 4.5项目连接到最近发布的Firebird 3.0。

I'm using Visual Studio 2015 Community edition, Firebird 3 (64 bit), and used NuGet to get the ADO.NET 4.10.0.0. 我正在使用Visual Studio 2015社区版,Firebird 3(64位),并使用NuGet来获取ADO.NET 4.10.0.0。

However, when I try to connect, I get an exception withe the following message: 但是,当我尝试连接时,我收到以下消息的异常:

this.connect.ServerVersion threw an exception of type 'System.InvalidOperationException' this.connect.ServerVersion抛出了类型'System.InvalidOperationException'的异常

Some other messages that I get: 我得到的其他一些消息:

Message: "The connection is closed" 消息:“连接已关闭”
Source: FirebirdSQL.Data.Fierbird.Client 来源:FirebirdSQL.Data.Fierbird.Client
StackTrace: 堆栈跟踪:
at FirebirdSql.Data.FirebirdClient.FbConnection.get_ServerVersion() in C:\\Users\\Jiri\\Documents\\devel\\NETProvider\\working\\NETProvider\\src\\FirebirdSql.Data.FirebirdClient\\FirebirdClient\\FbConnection.cs:line 217 at FirebirdSql.Data.FirebirdClient.FbConnection.get_ServerVersion()在C:\\ Users \\ Jiri \\ Documents \\ devel \\ NETProvider \\ working \\ NETProvider \\ src \\ FirebirdSql.Data.FirebirdClient \\ FirebirdClient \\ FbConnection.cs:第217行

IBExpert connects without any problems. IBExpert连接没有任何问题。

This environment previously worked with Firebird 2.5 and an older ADO.Net 此环境以前与Firebird 2.5和较旧的ADO.Net一起使用

Best guess right now is that it's not supported but my research online was inconclusive (from what I could find, there were indications that it was tested with Firebird 3 RC1) 现在最好的猜测是,它不受支持,但我的在线研究尚无定论(从我能找到的,有迹象表明它是用Firebird 3 RC1测试的)

If anyone can point me in the right direction to get this going, it would be awesome. 如果有人能指出我正确的方向来实现这一目标,那将是非常棒的。

Thanks in advance! 提前致谢!

I am answering this on the assumption that you installed Firebird 3 and did not modify any of its configuration. 我假设您安装了Firebird 3并且没有修改任何配置,我正在回答这个问题。 By default the installation of Firebird 3 will have some strict security settings: 默认情况下,Firebird 3的安装将具有一些严格的安全设置:

  • It will only support the new SRP authentication model 它只支持新的SRP身份验证模型
  • It will require wire protocol encryption 它将需要有线协议加密

This means that drivers (like Firebird .NET provider 4.10) that do not yet support the SRP authentication model and wire protocol encryption will not be able to connect out of the box. 这意味着尚不支持SRP身份验证模型和有线协议加密的驱动程序(如Firebird .NET提供程序4.10)将无法立即连接。

To be able to connect you will need to do the following 为了能够连接,您需要执行以下操作

  1. Enable the legacy authentication model 启用旧版身份验证模型
  2. Downgrade the wire protocol encryption setting from required to enabled 将有线协议加密设置从必需降级为启用
  3. Create a user in the legacy authentication model 在旧版身份验证模型中创建用户

These steps all require edits to firebird.conf . 这些步骤都需要编辑firebird.conf If you installed Firebird into Program Files , you need to make sure your editor is running as administrator to be able to save the changes. 如果您将Firebird安装到Program Files ,则需要确保您的编辑器以管理员身份运行才能保存更改。

Enable legacy authentication 启用旧版验证

To enable legacy authentication, you need to edit or add the following line to firebird.conf : (note that lines prefixed with # are comments!) 要启用旧版身份验证,您需要编辑或添加以下行到firebird.conf :(注意前缀为#是注释!)

AuthServer = Srp, Legacy_Auth

Downgrade wire protocol encryption 降级有线协议加密

To downgrade the wire protocol encryption setting, you need to edit or add the following line to firebird.conf : 要降级有线协议加密设置,您需要编辑或添加以下行到firebird.conf

WireCrypt = Enabled

Create a legacy authentication user 创建旧版身份验证用户

To be able to create a user in the legacy authentication model, you need to enable the legacy usermanager plugin by editing or adding the following line to firebird.conf : 为了能够在旧版身份验证模型中创建用户,您需要通过编辑或向firebird.conf添加以下行来启用旧版用户管理器插件:

UserManager = Srp, Legacy_UserManager

After above changes, restart Firebird, connect to (any) Firebird 3 database with your favorite database management tool using SYSDBA or another admin account and create a user using the Legacy_UserManager with CREATE USER (replace username and password legacy with suitable values): 完成上述更改后,重新启动Firebird,使用您最喜欢的数据库管理工具使用SYSDBA或其他管理员帐户连接到(任意)Firebird 3数据库,并使用带有CREATE USER的Legacy_UserManager CREATE USER (用适当的值替换legacy用户名和密码):

CREATE USER legacy PASSWORD 'legacy' USING PLUGIN Legacy_UserManager

Make sure to commit, otherwise the user is not really created. 确保提交,否则用户不是真正创建的。

Now you should be able to connect from C# using the user you just created. 现在,您应该能够使用刚创建的用户从C#连接。

This is also documented in the Firebird 3 Release Notes, Chapter 12 Compatibility Issues, Legacy Authentication . Firebird 3发行说明,第12章兼容性问题,传统身份验证中也记录了这一点。

Using gsec or the services functionality to create users is deprecated. 不建议使用gsec或服务功能来创建用户。 If you still want to use either of these to create users in the legacy authentication model, you need to edit firebird.conf and put Legacy_UserManager first in the list. 如果您仍希望使用其中任何一个在旧版身份验证模型中创建用户,则需要编辑firebird.conf并将Legacy_UserManager放在Legacy_UserManager第一位。

Support in Firebird .NET provider version 5.0.0.0 and higher 支持Firebird .NET提供程序版本5.0.0.0及更高版本

Note that Firebird .NET provider version 5.0.0.0 added support for SRP (without wire protocol encryption). 请注意,Firebird .NET提供程序版本5.0.0.0添加了对SRP的支持(无线协议加密)。 So from Firebird .NET provider version 5 you can use the new authentication model. 因此,从Firebird .NET提供程序版本5,您可以使用新的身份验证模型。 Just make sure that you downgrade the wire protocol encryption (setting WireCrypt ) from Required (default) to Enabled as described above. 只需确保将有线协议加密(设置WireCrypt )从Required (默认)降级为Enabled ,如上所述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM