GCC 的 InstallUtill 编译的 .exe 收到 System.BadImageFormatException

发布于 2024-09-15 20:17:17 字数 654 浏览 2 评论 0原文

我正在尝试使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暗藏城府 2024-09-22 20:17:20

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

InstallUtil is used to install .Net applications as services. Unless GCC can produce managed assemblies, you should be using sc.exe instead to create a Windows service entry for your application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文