0

I am working on a web api project that uses NServiceBus. Every time I start my NserviceBus host the debug process breaks and I get a "No Source Available" message and I can't figure out what's going on. I can send the message from my api project and the host will pick it up by simply I continue past the error, but every time I start the host I get that message.

My nservicebus configuration:

        // nservicebus configuration
        Configure.WithWeb()
                 .DefaultBuilder()
                 .ForWebApi()
                 .Log4Net()
                 .XmlSerializer()
                 .MsmqSubscriptionStorage()
                 .MsmqTransport()
                     .IsTransactional(false)
                     .PurgeOnStartup(false)
                 .UnicastBus()
                    .ImpersonateSender(false)
                 .CreateBus()
                 .Start(() => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());

My web.config:

<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
</configSections>

<MsmqTransportConfig ErrorQueue="Error" NumberOfWorkerThreads="1" MaxRetries="5" />
<UnicastBusConfig>
<MessageEndpointMappings>
  <add Messages="Messages" Endpoint="Domain" />
</MessageEndpointMappings>
</UnicastBusConfig>

The app.config:

<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
</configSections>
<MsmqTransportConfig ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5" />
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />

My handler implements IHandleMessages and when I continue past the error message it seems to handle the message and the endpoint is configured as a server. When the console window for NServiceBus comes up if there are messages already in the queue I get error messages telling me that the endpoint is not configured as a publisher.

I am using NServiceBus 3.0.0.

Thanks for any input.

crunchy
  • 705
  • 1
  • 13
  • 35
  • Do you have a web project which is using NServiceBus to send messages to another process? If so, can you include the config/init code of that other process? – Udi Dahan Nov 26 '12 at 18:00
  • I'm only using the .NET Web API, the web.config above, and the process that receives the message uses the app.config above. Other than changing the injection configuration to use System.Web.Http (thanks to [http://coderkarl.wordpress.com/2012/03/16/injecting-nservicebus-into-asp-net-webapi/] Karl Nilsson and [http://www.make-awesome.com/2011/02/injecting-nservicebus-into-asp-net-mvc-3/] David Boicke it's very similar to the AsyncPagesMVC3 sample. – crunchy Nov 26 '12 at 20:06
  • Are you publishing an event as a part of your processing logic? If so, you'd need to change your endpoint config class to implement AsA_Publisher rather than AsA_Server. – Udi Dahan Nov 27 '12 at 14:43
  • Udi, that fixes the issue with the endpoint configuration (thanks) but I still get the "no source available" message when I start the host – crunchy Nov 27 '12 at 18:24

0 Answers0