In MassTransit 4.5.1x20 and later versions, MassTransit runs as a service directly. This article describes the new method to install and uninstall MassTransit as a service. It also describes the enhanced scripting capabilities of MassTransit that result from this change.
All MassTransit versions prior to 4.5.1x20 required users to run mtservice.exe when running MassTransit as a service. It also required users to run reregister.bat file when upgrading to a newer version of MassTransit. When running as a service, MassTransit could not be accessed by scripts run by the user or in other non-service contexts.
MassTransit 4.5.1x20 does not require mtservice.exe to run as a service and can be accessed by scripts running in any context regardless of whether it is running as an appplication or as a service. Two new batch files are now provided to simplify the procedure needed to install and uninstall MassTransit as a service.
To configure and run MassTransit as a service:
CreateMTService.batin your MassTransit directory. This file is distributed with all versions of MassTransit 4.5.1x20 and later.
MassTransit Service should now appear in Services window.
- To start running MassTransit as a service, select the MassTransit service entry and click the "Start Service" button on the menu bar.
To remove the MassTransit service:
RemoveMTService.batin your MassTransit directory. This file is distributed with all versions of MassTransit 4.5.1x20 and later.
The MassTransit Service should now be removed from the Services window.
RemoveMTService.bat will remove all service configurations associated with MassTransit.