Paul T Davies
Paul T Davies

Reputation: 2573

Which identity is Topshelf service running as?

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?

Service Logon window

Upvotes: 1

Views: 552

Answers (1)

CoreTech
CoreTech

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

Related Questions