Click here to Skip to main content
15,906,455 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi friends,

I had created a windows service in layered architecture.Then I installed it in the command prompt(not in the Visual Studio Command Prompt)using the command "Installutil"
I got the error "Could not load file or assembly +"path name" +or one of it's dependencies.An attempt was made to load a program with an incorrect format"
Can anybody help me...
Posted
Updated 9-Nov-11 1:55am
v3
Comments
hitech_s 9-Nov-11 7:54am    
why dont you use visual studio command prompt?
Aabidhabanu 9-Nov-11 7:58am    
Wen Visual Studio command prompt is opened,an error was displayed by default "Error:Cannot determine the location of the VS common Tools folder".


1 solution

Make sure that the service's DLL and all dependent DLLs are compiled with the same target type (ie 32 or 64 bit).
 
Share this answer
 
Comments
Aabidhabanu 10-Nov-11 1:04am    
Thankyou very much...I also sorted out another problem along with this.My system didnot have local administration rights & that was also an another cause.Moreover I have changed the Windows Service project's platform target into "Any CPU" which supports all the target types as u had mentioned.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900