将NServiceBus从版本3升级到4并在编译时出现此错误:
错误CS0234:类型或命名空间名称' Impl'命名空间中不存在NServiceBus.Sagas' (你错过了一个程序集引用吗?)
if (NServiceBus.Sagas.Impl.Configure.SagasWereFound)
{
var connStr = ConfigurationManager.AppSettings["DB"];
// Register session factory which takes care of managing
// the database connections and transactions
Configure.Instance.Configurer.ConfigureComponent(typeof(OracleSagaSessionFactory),
DependencyLifecycle.InstancePerCall)
.ConfigureProperty("ConnectionString", connStr);
// Then register the saga persister itself
Configure.Instance.Configurer.ConfigureComponent(typeof(OracleSagaPersister),
DependencyLifecycle.InstancePerCall);
}
答案 0 :(得分:2)
你应该可以使用:
NServiceBus.Features.Feature.IsEnabled<Features.Sagas>()