2011-05-12 64 views

回答

0

覆盖BeginStart并调用UseConfiguration。这里的示例代码是为我工作:

public class RemoteAppBootstrapper : AutofacBootStrapper 
{ 
    protected override void OnBeginStart() 
    { 
     var busConfiguration = new HostConfiguration() 
      .Bus("msmq://localhost/endpoint.a") 
      .ToBusConfiguration(); 

     UseConfiguration(busConfiguration); 

     base.OnBeginStart(); 
    } 
} 
0
var cashier = new RemoteAppDomainHost(typeof(CashierBootStrapper)) 
       .Configuration("Cashier.config"); 
cashier.Start(); 

查看您的引导程序https://github.com/BjRo/LearningRhinoServiceBus

+0

JarretV-感谢您的答案,但我正在寻找一种方法来避免配置文件。 – 2012-03-26 18:54:14