Reputation: 2573
There appears to be two ways to specify the identity a Topshelf service. One is in code like these examples:
configure.RunAsLocalSystem();
configure.RunAs("MYDOMAIN\username", "password");
And then there is the user specified in the Services application in Windows, where you right click on the service and select Properties and go to the Log On tab.
Which of these takes precedence? Or are they relating to different things?
Upvotes: 1
Views: 552
Reputation: 2433
They refer to the same thing. Topshelf and Services.msc are manipulating the underlying windows service entity.
Both methods will ultimately use the ChangeServiceConfig API function to set the service's the user name and password (or possibly CreateService, when TopShelf is creating).
Upvotes: 1