Deploy Windows Services
(1) create a new Windows Service Project server1
(2) Enable service1 CodeView, locate the onstart part, and add the code
(3) switch to the design view, right-click to add and install Program
(4) switch to the newly generated project installer. in the CS design view, locate serviceprocessinstaller1, set the account attribute to LocalSystem, and set the servicename attribute of serviceinstaller1 to server1 (Service name ), starttype attribute is set to automatic (the service is automatically started when the system starts)
(5) Close the project.
(6) create a new installation project serversetup (create an installation project for the service just now)
(7) Right-click and choose add> project output> main output> service1> OK.
(8) Right click-View-custom operation-custom Operation Right click-add custom operation-open application folder-select the primary output just now-OK
(9) re-build the installation project-right-click to install
(10) In the Service Manager (my computer-right-click-Manage-services and applications-services) Find the server1 service and start the service
DOS installation service
First go to the directory: C: \ WINDOWS \ Microsoft. NET \ framework \ v2.0.50727
Then: installutil ???. EXE installation service
Installutil ???. EXE/u uninstall service