0

I have written a service to host NServiceBus and for some reason NServiceBus is shutting down almost immediately after starting the service. If I run the executable manually everything works exactly as it should but as a service it decides to shutdown without an error being logged. Below is an example of the log files:

  1. Selected active license from C:\ProgramData\ParticularSoftware\license.xml
  2. Security warnings are reported due to opening up some of the security for testing purposes
  3. Initiating shutdown.
  4. Shutdown complete.

All of this takes place in 0.48 seconds.

This is a .net 4.6.1 application as my organization doesn't allow .net core at this point.

dmoore1181
  • 1,793
  • 1
  • 25
  • 57
  • If you modify the service to run under your own windows account does it work? If so then this is simply permissions related. – tom redfern Dec 16 '18 at 11:03
  • I was able to log into the server with the service account and run it manually (run the .exe file) and it worked correctly. There shouldn't be any permission issues. – dmoore1181 Dec 16 '18 at 19:55

1 Answers1

1

I have finally figured out the answer, I had 2 separate ways of closing the connection with NServiceBus, one was supposed to be used in the case that it was being ran as a console app, while the other was for when a service was running. The problem was that the one for the console app was also being hit by the service before it was supposed to, I have now resolved that issue.

dmoore1181
  • 1,793
  • 1
  • 25
  • 57