ServiceBase service error 193:0xc1 on Windows XP

蹲街弑〆低调 提交于 2019-12-02 01:13:27

You must have compiled your exe either for .Net 4.5 or for 64-bit architecture (or both). This is the explanation of error code you run into from WinError.h:

// %1 is not a valid Win32 application.
//
#define ERROR_BAD_EXE_FORMAT             193L

Make sure you have compiled it for x86 platform or Any CPU, and whatever version of .Net Framework you compiled against is installed on the machine.

I found this after googling the windows service error number: *Generally the error message means that the service manager couldn't find the exact .exe path to run the service. Sometimes, the service is installed from a directory with multiple words for the directory name. So the registry path to the service needs to be placed with double quotes.

Click ‘Start’ and type ‘services.msc’ and hit Enter Check for the multimedia class scheduler and audio endpoint builder service. Check for the path under "path to executable:" for both the services. Make a note of the same. Also make a note of the service name for both the services. The services are as follows:

AudioEndpointBuilder - AudioEndpointBuilder Multimedia Class Scheduler - MMCSS

Now, let’s check if the paths under these two services are the same as well in the registry. Click ‘Start’, type regedit and hit Enter Locate the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ Under services, check for these services: MMCSS and AudioEndpointBuilder. Corresponding to the above two services, the Image path (on the right pane) should be same as the path in ‘services.msc’*

I found it here

In my case, this was due to building with target of 64-bit only. I forgot that one of my test servers running Server 2003 was 32-bit. My service runs fine on the 64-bit Server 2008 R2 box.

I think that there is a compatibility problem with .net framework that you use and windows server 2003.Do you use .net 4.5? Windows server 2003 can't run applications which target net framework 4.5.

http://www.microsoft.com/visualstudio/eng/products/compatibility

So you could change your target framework to 4.0.

In our case this happened after a server crash and the exe file got corrupted. We re-deployed the binaries and then the service started successfully.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!