![]() ![]() Ruben's observation above about the 32 bit output of Visual Studio 2010 was the saviour here. An attempt was made to load a program with an incorrect format. System.BadImageFormatException: Could not load file or assembly '' or one of its dependencies. I wrote the service and tried to install it using installutil.exe and got the following error: It was just practice for the real thing later. I wrote a test service that didn't really do anything. OK, this is the problem I had, and, what fixed it, seems very relevant to the above. vdproj Install Project type generates a 32-bit InstallUtilLib shim, even on an 圆4 system (Search for "64-bit managed custom actions throw a System.BadImageFormatException exception" on the page). NET version number of the installutil you are running to be >= (preferably =) that of the EXE/DLL file you are running the installer of.įinally, note that in Visual Studio 2010, the tooling will default to generating x86 binaries ( rather than Any CPU as previously).Ĭomplete details of System.BadImageFormatException (saying the only cause is mismatched bittedness is really a gross oversimplification!).Īnother reason for a BadImageFormatException under an 圆4 installer is that in Visual Studio 2010, the default. Obviously, as covered in the other answer, one will also need the. Will not work (substitute in other framework versions: v (32-bit only, so this issue doesn't arise) and v9 as desired in the above). %windir%\Microsoft.NET\Framework 64\v7\installutil.exe %windir%\Microsoft.NET\Framework\v7\installutil.exe ![]() If your platform is non-specific ( /platform:An圜pu), this won't arise (assuming no referenced dependencies are of the wrong bitness). load a 64 bit-specific ( /platform:圆4) DLL into a process that is 32 bit). Note that the most common reason for this exception these days is attempting to load a 32 bit-specific ( /platform:x86) DLL into a process that is 64 bit or vice versa (viz. Some more detail for completeness in case it helps someone. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |