1

I tried to install a Windows service from VC++ MFC project using InstallUtil.exe and got the error message as below.

C:\Users\p.gamage\Documents\Visual Studio 2015\Projects\MFCDatabaseTuts\x64\Debug>installutil MFCDatabaseTuts.exe
Microsoft (R) .NET Framework Installation utility Version 4.7.2046.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Users\p.gamage\Documents\Visual Studio 2015\Projects\MFCDatabaseTuts\x64\Debug\MFCDatabaseTuts.exe'
or one of its dependencies. The module was expected to contain an assembly manifest..

I googled for error, many blogs,forums including Stackoverflow say, This could be a 32 bit vs 64 bit compatibility issue.But I'm using x64 bit System. And also build done for x64.

Why this occurs? Any help would be greatly appreciated.

Thanks.

Prabath
  • 43
  • 1
  • 7
  • You cannot install a plain old .exe file with [__installutil__](https://learn.microsoft.com/en-us/dotnet/framework/tools/installutil-exe-installer-tool), but only a .net assembly which is something completly different.. – Jabberwocky Nov 15 '17 at 17:04
  • @MichaelWalz I didn't aware of that. Anyway thanks. – Prabath Nov 16 '17 at 06:14

0 Answers0