 <p>The problem is because of this:</p> <pre><code>service.WaitForStatus(ServiceControllerStatus.Stopped, timeout); </code></pre> <p>This is happening because your service has not stopped within your <code>timeout</code>. You should either set your timeout higher, or don't set a timeout at all.</p>