Link to home
Start Free TrialLog in
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

asked on

Could not load file or assembly 'file:///D:\Domains\XxxService\XxxPmtService.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format

Hello Experts,
I am working on a Windows Service application in C#.  It is working fine in local machine.  I am getting the following error message when try to install in Production box.  I have set the Platform Target to Any CPU and Target Framework to .NET Framework 4.5. .  Also I tested it by changing the Platform Target to x86  and to x64.  But still getting the same error.  Please let me know how to fix it.  Thank you in advance.

Error Message
----------------------------
Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///D:\Domains\XxxService\XxxPmtService.exe'
or one of its dependencies. An attempt was made to load a program with an incorrect format..

Installation
------------------
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>installutil -i D:\Domains\XxxService\XxxPmtService.exe
ASKER CERTIFIED SOLUTION
Avatar of Dirk Strauss
Dirk Strauss
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

ASKER

Thank you Dirk Strauss, that worked.  A++ expert.  Thank you again!