Deploying .NET Core as a Windows Service | How to Use NSSM

2020年11月9日 40点热度 1人点赞 5条评论
内容目录

After the Dotnet SDK/Runtime is installed, you can see a file named dotnet.exe in the C:\Program Files\dotnet directory.

  1. Copy your dotnet program (.dll, .exe, configuration files, etc.) to an appropriate directory.

  2. Extract the nssm-2.24.zip file, open cmd or PowerShell and navigate to the nssm directory, then execute

.\nssm.exe install

A window will pop up as shown below

file

NSSM download links:
https://nssm.cc/download
https://www.nuget.org/packages/NSSM

  1. Interface explanation
    • In the Application Path, fill in C:\Program Files\dotnet\dotnet.exe;
  • In the Startup directory, enter the directory where the monitoring program package is located;

  • In the Arguments, enter AAA.dll

  • For the Service name, specify the name of the monitoring program in the Windows services, for example, if you fill in AAA, you can set it freely;
    file

Then click Install service to complete the installation. After that, you can open the Task Manager, click "Services", and see the program.

痴者工良

高级程序员劝退师

文章评论