Windows services GCC编译的.exe的InstallUtill接收System.BadImageFormatException

Windows services GCC编译的.exe的InstallUtill接收System.BadImageFormatException,windows-services,service,installutil,badimageformatexception,Windows Services,Service,Installutil,Badimageformatexception,我正在尝试在windows中将GCC编译的.exe用作服务。根据我的研究,我应该做: C:\Windows\Microsoft.net\Framework\v2.0.50727\InstallUtil.exe [program name] 尽管当我尝试这样做时,我会收到这样一条消息: Exception occurred while initializing the installation: System.BadImageFormatException: Could not load f

我正在尝试在windows中将GCC编译的.exe用作服务。根据我的研究,我应该做:

 C:\Windows\Microsoft.net\Framework\v2.0.50727\InstallUtil.exe [program name] 
尽管当我尝试这样做时,我会收到这样一条消息:

Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Users\Chris\Documents\Visual Studio 2010\Projects\Setup4\Setup4\Service.exe' or one of its dependencies. The module was expected to contain an assembly manifest..
我有一种感觉,这是因为该程序是使用GCC编译的,并且确实使用了一些.a文件进行编译


从我所看到的系统中,BadImageFormatException通常是由某种错误清单引起的。有人能帮我吗?

InstallUtil
用于将.Net应用程序作为服务安装。除非GCC可以生成托管程序集,否则您应该使用
sc.exe
为应用程序创建Windows服务条目