1..net core site to find bin directory on the deployment of the background layer to open cmd enter the command: dotnet publish -c release -r win7-x64 (release version) dotnet publish -c debug -r win7-x64 (debug version)
2..net core hosting services in Windows PowerShell with administrator permissions to open enter the command:
$acl = Get-Acl "{EXE PATH}"
$aclRuleArgs = {DOMAIN OR COMPUTER NAME\USER}, "Read,Write,ReadAndExecute", "ContainerInherit,ObjectInherit", "None", "Allow"
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($aclRuleArgs)
$acl.SetAccessRule($accessRule)
$acl | Set-Acl "{EXE PATH}"
New-Service -Name {NAME} -BinaryPathName {EXE FILE PATH} -Credential {DOMAIN OR COMPUTER NAME\USER} -Description "{DESCRIPTION}" -DisplayName "{DISPLAY NAME}" -StartupType Automatic
{EXE PATH}
- path to the application on the host folder (such asd:\myservice
). Do not include the executable file the application in this path. Non-essential item trailing slash.{DOMAIN OR COMPUTER NAME\USER}
- service user account (such asContoso\ServiceUser
).{NAME}
- service name (such asMyService
).{EXE FILE PATH}
- path to the application executable file (such asd:\myservice\myservice.exe
). Please file name and extension of the executable file included.{DESCRIPTION}
- Service description (such asMy sample service
).{DISPLAY NAME}
- service display name (such asMy Service
).