본문 바로가기

NET/C#

윈도우서비스 에러 관련

http://stackoverflow.com/questions/11059284/badimageformatexception-error-in-using-installutil-tool

http://www.pressingquestion.com/87919/C-Powershell-Snapin-Not-Registering-Using-Installutil

설치를 초기화하는 동안 예외가 발생했습니다.
System.BadImageFormatException: 파일이나 어셈블리 'file:///D:\DocumentDataSync.exe' 또는 여기에 종속되어 있는 파일이나 어셈블리 중 하
나를 로드할 수 없습니다. 프로그램을 잘못된 형식으로 로드하려고 했습니다.

Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 'file:///C:\bin Debug\MyTestService.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format..

64비트로 열어서 사용하면 문제가 없었음

Experienced the same issue - I was trying to use command

C:\Windows\Microsoft.net\Framework\V4.0.30319\installutil myDLL.dll 

instead of

C:\Windows\Microsoft.net\Framework64\V4.0.30319\installutil myDLL.dll 

while having 64 bit cmdlet (project config. Any CPU) on OS win2k8 x64..