如何使用 FluentMigrator 创建链接服务器?

How to create a linked server using FluentMigrator?

我尝试 运行 一个常规 Sql 脚本使用 Execute.Sql() 方法在我的生产环境中创建链接服务器对象FluentMigrator,但我从 MS Sql 服务器收到以下错误:

The error was The procedure 'sys.sp_addlinkedserver' cannot be  executed within a transaction.  
The procedure 'sys.sp_addlinkedsrvlogin' cannot be executed within a transaction.

有没有办法在 FluentMigrator 打开的事务之外执行脚本?

非常感谢。

我通过使用另一个 SqlConnection 和 SqlCommand 执行提到的脚本来解决这个问题 运行 FluentMigrator 事务之外的提到的脚本。
欢迎任何其他解决方案。

我也在正常交易之外运行它,通过这样装饰属性:

[Migration(201604061643, TransactionBehavior.None)]

这是当前版本中的一项新功能,如下所述: https://github.com/schambers/fluentmigrator/wiki/Transaction-modes-for-the-migration-runner