Database Reference
In-Depth Information
NSB hosting versus self-hosting
NServiceBus.Host is an executable that will deploy the NSB service. When the NSB
service is compiled, it turns into a Windows DLL that may contain all the configuration
settings for the IBus. If there are additional settings needed for the endpoint's configuration
that are not coded in the IBus's configuration, then it can be resolved by setting these con-
figurations in the Host command.
However, NServiceBus.Host need not be used to create the program that is used in
NServiceBus. As a developer, you can create a console program that is run by a Window's
task scheduler, or even create your own services that run the NSB IBus code as an end-
point. We can see samples of this type of code in the MVC samples in other chapters. Not
using the NSB-hosting engine is normally referred to as self-hosting.
The NServiceBus host streamlines service development and deployment, allows you to
change technologies without code, and is administrator friendly when setting permissions
and accounts. It will deploy your application as an NSB-hosted solution. It can also add
configurations to your program at the NServiceBus.Host.exe command line. If you
develop a program with the NServiceBus.Host reference, you can use End-
poinConfig.cs to define your IBus configuration in this code, or add it as part of the
command line instead of creating your own Program.cs that will do a lot of the same
work with more code. When debugging with the NServiceBus.Host reference, the
Visual Studio project is creating a windows DLL program that is run by the Nser-
viceBus.Host.exe command.
Here's an example form of the properties of a Visual Studio project:
Search WWH ::




Custom Search