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服務條目。