Created
April 10, 2020 09:25
-
-
Save cdcd72/c1f11028864545544535283cb6f2fb3f to your computer and use it in GitHub Desktop.
.Net core worker service deploy as windows service & control windows service script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build and Publish Application | |
dotnet build | |
dotnet publish -c Release -o "PathToPublish" | |
# Create ServiceName Service | |
sc.exe create ServiceName binpath="PathToPublish\ServiceName.exe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start ServiceName Service | |
sc.exe start ServiceName | |
# Stop ServiceName Service | |
sc.exe stop ServiceName | |
# Query ServiceName Service Status | |
sc.exe query ServiceName | |
# Delete ServiceName Service | |
sc.exe delete ServiceName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment