Ongoing Notes

NServiceBus

All entries here should be taken with a big pinch of salt. There are my notes whilst playing around with NServiceBus.  If you see something is wrong then feel free to let me know.

Configuring your DLL project to run as a host

One not-so obvious gotcha is that to use the NServiceBus.Host.Exe your DLL must reference NServiceBus.Host.Exe. Ok maybe that is obvious, but when you go to the project properties to change the startup option to that exe it isn’t in your bin folder. You must build the project before it copies the EXE into the folder. So Build once then change the startup option.

Pub/Sub

The first thing that has caught me out is that I assumed that when you Bus.Publish a message it will go into a queue for subscribers to read the messages from. This looks like an incorrect assumption. If you publish a message and no-one has subscribed then the message is “lost”.

More later

More later

3 thoughts on “Ongoing Notes

  1. Jonathan Oliver March 12, 2011 / 4:29 pm

    A little trick to avoid copying the NServiceBus.Host.exe to your bin manually (or having to compile) before changing your project properties is to modify your project file and add the following:

    Program
    $(ProjectDir)$(OutputPath)NServiceBus.Host.exe
    NServiceBus.Production

  2. Jonathan Oliver March 12, 2011 / 4:29 pm

    It looks like it stripped out the HTML tags of my previous comment.

  3. Jonathan Oliver March 12, 2011 / 4:41 pm

    Try adding this to your project file:

    <PropertyGroup>
    <StartAction>Program</StartAction>
    <StartProgram>$(ProjectDir)$(OutputPath)NServiceBus.Host.exe</StartProgram>
    <StartArguments>NServiceBus.Production</StartArguments>
    </PropertyGroup>

Leave a comment