0

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?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
ZYbit
  • 7
  • 2

1 Answers1

2

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.

Franci Penov
  • 74,861
  • 18
  • 132
  • 169