|
|
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
|