The code you provided is the correct method for applying the user. This includes several things ...
- This only works for Windows services, if you run it as a console application, it will still work as you
- All complete processes run as a host user, so the shelves ignore any user settings.
- You can double-check the user for whom the service is registered, for example, by going to services in mmc, find your service, go to the properties panel and on the "Login" tab, which displays the user to whom the service should work.
If you just use the console application, just servicename install start and it should work as the user for whom it was configured.
If this does not help, please visit the http://groups.google.com/group/topshelf-discuss mailing list.
source share