Running as Windows service
The following actions require a command line window with local Administrator permissions.
Create windows service
Ensure that all Prerequisites are installed
Open a command line window and navigate to the folder where you copied DpeNanoServices to
Optionally adapt your configuration in the appsettings.json file
Register DpeNanoServices as windows service, e.g.
CODEsc.exe create DpeNanoServices binPath= "C:\my-full-path-to-folder\DpeNanoService.exe --environment Production --urls http://localhost:5000"
Alternatively you can do
CODEsc.exe create DpeNanoServices binPath= "dotnet C:\my-full-path-to-folder\DpeNanoService.dll --environment Production --urls http://localhost:5000"
Use standard windows service configuration dialog to configure a dedicated user account used to run DpeNanoServices
Delete windows service
sc.exe delete DpeNanoServices
Change windows service configuration
Change start type to “Automatic (Delayed)”
sc.exe config DpeNanoServices start= delayed-auto
Run the service under a dedicated user account
sc.exe config DpeNanoServices type= own obj= "domain\user" password= "password"
The account must have the “log in as service right”. The standard windows service configuration dialog handles a missing right automatically.
Alternatively you can grant the right from command-line
ntrights.exe +r SeServiceLogonRight -u "%DOMAIN%\%USER%"
Query windows service configuration
sc.exe query DpeNanoServices
sc.exe qc DpeNanoServices