title: Asynchronous pages - Mass Transit - Service Bus
body: <p>I am trying to learn how to use Mass Transit found <a href="http://masstransit-project.com/" rel="nofollow">here</a>.</p>
  
  <p>I have made a project with two consoles and can get them talk to each other. Essentially I just followed the samples that came with it and kind of learnt that way.</p>
  
  <p>I am now trying to get Mass Transit work with a web application. I made a new web app in VS2010 with the sample project stuff and just added a button to the page. The idea is when you click the button it adds a message to the queue and I was just going to have the sample app for Starbucks (the one that comes with Mass transit), it read the message from the queue (the Cashier or Barista console). So essentially, I am trying to make the Starbucks 'customer' program into a web interface. </p>
  
  <p>The problem:</p>
  
  <p>I read the docs and it appears I have to initialize the service bus in the global app on Application_Start. I do this and then call it on the button. I just use:</p>
  
  <pre><code> sbc.UseMsmq();
   sbc.ReceiveFrom("msmq://localhost/test_queue");
   sbc.UseControlBus();
  </code></pre>
  
  <p>in the initialize. </p>
  
  <p>The button I just have:</p>
  
  <pre><code>var message = new NewOrderMessage
  {
  CorrelationId = _transactionId,
  Item = "1",
  Name = "1",
  Size = "1",
  };     
  bus.Publish(message);
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code>Bus.Instance.Publish(message, x =&gt; x.SetResponseAddress(Bus.Instance.Endpoint.Address.Uri));
  </code></pre>
  
  <p>and a whole bunch of other stuff. </p>
  
  <p>It throws an error but in:</p>
  
  <p>ServiceBusConfiguratorImpl.cs </p>
  
  <p>the line that says:</p>
  
  <pre><code>builder = configurator.Configure(builder);
  </code></pre>
  
  <p>The error being:</p>
  
  <pre><code>Could not load file or assembly 'Stact, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b800c4cfcdeea87b' or one of its dependencies. The system cannot find the file specified
  </code></pre>
  
  <p>So I am a bit lost... </p>
  
  <p>Like I said, all I really want to do is change the 'customer' program from the Starbucks sample to a web interface so I can learn how to use mass transit for a web app. </p>
  
  <p>If anyone has a working sample or a tutorial on how to get this running it would be greatly appreciated. I have searched on google for a couple of hours but have not found anything helpful.... :S</p>
  
  <p>Thanks in advance,</p>
  
  <p>Kindest Regards,
  Robin</p>
  
  <p>.net, mass transit, MSMQ, C#, service bus</p>