GCC 的 InstallUtill 编译的 .exe 收到 System.BadImageFormatException
我正在尝试使用 GCC 编译的 .exe 作为 Windows 中的服务。根据我的研究,我应该这样做:
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通常是由某种不良清单引起的。有人可以在这里帮助我吗?
I am trying to use a GCC compiled .exe as a service in windows. From what I have researched I should do:
C:\Windows\Microsoft.net\Framework\v2.0.50727\InstallUtil.exe [program name]
Although when I try to do this I receive a message as such:
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..
I have a feeling that this is due to the fact that the program was compiled using GCC and did use some .a files to compile.
From what I see System.BadImageFormatException is usually caused by some sort of bad manifest. Would someone be able to help me out here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
InstallUtil
用于将 .Net 应用程序安装为服务。除非 GCC 可以生成托管程序集,否则您应该使用sc.exe
来为您的应用程序创建 Windows 服务条目。InstallUtil
is used to install .Net applications as services. Unless GCC can produce managed assemblies, you should be usingsc.exe
instead to create a Windows service entry for your application.