Install and Test Your Service
Copy the tutorials.exe from the bin\Release directory to the c:\temp directory, replacing the Tutorials.exe we created in Chapter 1. Open a Visual Studio Command Prompt window and switch to the c:\temp directory. Type installutil tutorials.exe and press Enter. After the service installs correctly, open the Services control panel utility by clicking Start, clicking Administrative Tools, clicking Control Panel, and then clicking Services. Then start the Tutorials service by right-clicking it and selecting Start. Using the Event Viewer, you will see the events from the <OnStart> and <ThreadFunc> methods. Stop the service and you will now see the event from the <OnStop> method.
Note
In subsequent chapters, I won’t explain ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access