This article is a mirror article of machine translation, please click here to jump to the original article.

View: 23149|Reply: 1

[Console Program] Windows installs the .net/c# service program

[Copy link]
Posted on 4/12/2018 10:44:30 PM | | | |

As shown in the figure above, we have written Windows services in .net/c#, how to install them? It's not right to double-click directly to open the program!

Installation services

Since the demo framework uses 4.5, enter cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 and enter
Switch to the current directory, it should be noted here that there are many similar versions in the C:\Windows\Microsoft.NET\Framework directory, which directory to go to depends on the running environment of the project, for example, if it is .NET Framework2.0, you need to enter cd C:\Windows\Microsoft.NET\Framework\v2.0.50727

(Remember to run cmd with admin commands)




Enter InstallUtil.exe E:...\TestServert.exe Enter
Description: E:...\TestServer.exe indicates the exe file location generated by the project


Open the service and you can see the service that has been installed

Uninstall the service

Uninstall is very simple, open cmd, just type sc delete TestServer. When deleting a service, the path E:...\TestServert.exe must exist, otherwise the deletion will not succeed.


Debugging

If you want to debug a program, you can use VS to attach it to the process for debugging, as shown in the figure below:






Previous:Unable to provide a process for a ADO.NET with the fixed name "System.Data.SqlClient"...
Next:.net/c# Xml, Json, Hessian, Protocol Buffers serialization comparison
Posted on 8/1/2018 1:26:24 PM |
Solved my problem very well Thanks
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com