Install C # service

https://www.cnblogs.com/zmztya/p/9577440.html

1. Run cmd as an administrator

2. Install windows service

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 (The path of InstallUtil.exe, note that the version number of InstallUtil.exe needs to be the same as the version number of the project)

3. Install windows service

InstallUtil.exe D:\Project related files\MonitoringTEST\DialTest\bin\Debug\ProjectTest.exe (path of the project)

4. Start windows Service

net start TestServive (service name)

At first, I didn’t dare to operate it, but I decided to try it when I encountered a problem. First, I found the above steps on the Internet. But I don’t understand (from the second step)

Note that the version number of InstallUtil.exe needs to be the same as the version number of the project

Understanding: cd actually points to a certain path (see Figure below), I found that there are several versions here, and then contact the third step, here is to say that your project file (the exe that needs to be installed and run) needs to be operated in which environment, then specify to a certain path under this path Versions to run. After actual operation, it is indeed feasible

Share a picture< /p>

share picture

Leave a Comment

Your email address will not be published.