2011-05-12 50 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