0

我想在Windows中使用GCC编译.exe作为服务。从我研究了我应该做的:InstallUtill的GCC编译.exe接收System.BadImageFormatException

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文件进行编译。

从我看到的System.BadImageFormatException通常是由某种不良的清单引起的。有人能帮助我吗?

回答

2

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