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.