Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154
In VS – project properties – in the Build tab – platform target =X86
In VS – project properties – in the Build tab – platform target =X86
It involves editing the registry, but service information can be found in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services. Find the service you want to redirect, locate the ImagePath subkey and change that value.
If I want to quickly debug the service, I just drop in a Debugger.Break() in there. When that line is reached, it will drop me back to VS. Don’t forget to remove that line when you are done. UPDATE: As an alternative to #if DEBUG pragmas, you can also use Conditional(“DEBUG_SERVICE”) attribute. [Conditional(“DEBUG_SERVICE”)] private static … Read more
Navigate to the installutil.exe in your .net folder (for .net 4 it’s C:\Windows\Microsoft.NET\Framework\v4.0.30319 for example) and use it to install your service, like this: “C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe” “c:\myservice.exe” Regarding a comment, for 64bit apps, use below: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil.exe
In short, services set to Automatic will start during the boot process, while services set to start as Delayed will start shortly after boot. Starting your service Delayed improves the boot performance of your server and has security benefits which are outlined in the article Adriano linked to in the comments. Update: “shortly after boot” … Read more
To create a Windows Service from an executable, you can use sc.exe: sc.exe create <new_service_name> binPath= “<path_to_the_service_executable>” You must have quotation marks around the actual exe path, and a space after the binPath=. More information on the sc command can be found in Microsoft KB251192. Note that it will not work for just any executable: … Read more
Use the SC command, like this (you need to be on a command prompt to execute the commands in this post): SC STOP shortservicename SC DELETE shortservicename Note: You need to run the command prompt as an administrator, not just logged in as the administrator, but also with administrative rights. If you get errors above … Read more
You have at least three options. I have presented them in order of usage preference. Method 1 – You can use the SC tool (Sc.exe) included in the Resource Kit. (included with Windows 7/8) Open a Command Prompt and enter sc delete <service-name> Tool help snippet follows: DESCRIPTION: SC is a command line program used … Read more
There may be several causes which lead to the service being stuck in “marked for deletion”. SysInternals’ Process Explorer is opened. Closing it should lead to automatic removal of the service. Task Manager is opened. Microsoft Management Console (MMC) is opened. To ensure all instances are closed, run taskkill /F /IM mmc.exe. Services console is … Read more