How to force uninstallation of windows service

I installed a windows service using installUtil.exe. After updating the code I used installUtil.exe again to install the service w/o uninstalling the original version first. When I now try to uninstall the service, installUtil.exe completes the uninstall successfully, but the service still appears. If I try to change its properties, I receive the message ‘service … Read more

Map a network drive to be used by a service

Suppose some Windows service uses code that wants mapped network drives and no UNC paths. How can I make the drive mapping available to the service’s session when the service is started? Logging in as the service user and creating a persistent mapping will not establish the mapping in the context of the actual service. … Read more

The type initializer for ‘MyClass’ threw an exception

The following is my Windows service code. When I am debugging the code, I am getting the error/ exception: The type initializer for ‘CSMessageUtility.CSDetails’ threw an exception. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Linq; using System.ServiceProcess; using System.Text; using System.IO; using System.Threading; using System.Windows; using System.Windows.Forms; using CSMessageUtility; namespace CS_Data_Trasmmiting_Service … Read more

Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154

I developed a Windows service using C#.NET to generate PDF report. To generate PDF file I am using a third party dll. The application is running in my Windows XP platform. When I deployed the service in Windows Server 2008 64 bit version, I got this error: Retrieving the COM class factory for component with … Read more