The recipe:

  1. create an empty class library project named SampleBusServer;
  2. delete the “Class1” file;
  3. add a reference, using nuget, to NServiceBus.Host;

Once done you should see something really similar to:

image

And if you tale a look at the project properties something like:

image

NServiceBus has its own built-in host, so our project is hosted by NServiceBus itself.

Now, as the project name implies, the role of this endpoint, start calling it with its role name, is to host a “server” endpoint whose role is to receive “messages”. In order to achieve this add a new class to the project named EndpointConfig like the following:

image

Press F5 and you should see this:

image

Amazing, we have a running NServiceBus host waiting…for nothing, but waiting :-)

.m