badimageformatexception

Are there size limitations to the .NET Assembly format?

We ran into an interesting issue that I've not experienced before. We have a large scale production ASP.NET 3.5 SP1 Web App Project in Visual Studio 2008 SP1 which gets compiled and deployed using a Website Deployment Project. Everything has worked fine for the last year, until after a check-in yesterday the app started critically fail...

ClickOnce: BadImageFormatException when running x86 package on 64 bit windows

My .NET 2.0 application imports unmanaged 32 bit dll. The dll is loaded (first interop call happens) when user opens a file via a dialog within the application. When I deploy the application via clickonce with target platform "Any", users on 64 bit windows get BadImageFormatException when trying to open files from the application (at th...

"An attempt was made to load a program with an incorrect format" even when the platforms are the same.

I'm calling functions from a 32-bit unmanaged DLL on a 64-bit system. What I get is: BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) At first, I had my projects set to the Any CPU platform, so I changed them both to x86, but this error is still occurring....

Release Web Binary With Both 64 and 32bit support? ASP.NET

I would like to release my app with both 32 and 64bit support. I am using elmah and SQLite. Both packages have a separate binary for 32 and 64bits. I cant add both 32 and 64bit DLL. I tried adding both 32 & 64 bit DLLs with a different filename in my bin/release folder and i get an bad image format error. (I tested by running on a Window...

"ResolveAssemblyReference" task fails and System.BadImageFormatException, but assembly isn't used anywhere!

I am getting an error about the assembly "C:\Ora10g\bin\Zip.exe". The trouble is this solution does NOT use anything in Oracle at all. I could not find a single reference to 10g anywhere in the project. I inherited this from another person who left our group. He never had this issue. Another member of my team said he got this before but ...

BadImageFormatException when loading 32 bit DLL, target is x86

I have a DLL (FreeType) which is certainly 32-bit (header: IMAGE_FILE_MACHINE_I386). I want to use it from C# code, using DllImport. Target of my application is x86, IntPtr.Size is 4, process is 32-bit. But I get BadImageFormatException (Exception from HRESULT: 0x8007000B). What can be wrong? Of course I use 64-bit Windows 7. ...

Anybody seen this behavior with Sql Server Reporting Services, a 64bit OS and an Oracle datasource?

I'm working on a Sql Server Reporting Services solution that queries across both a Sql Server data source and an Oracle 10g data source. My dev box is Windows 7 64bit with Sql Server 2008R2 and I'm hosting IIS7 and SSRS on that system for development; using VS.NET for designing the reports. I have been having errors when running the rep...

BadImageFormatException with .NET ILMerged DLL in Windows 7 64

I'm developing in Windows 7 64-bit with Visual Studio 2008. I have a collection of class libraries that I merge into a single DLL using ILMerge. When I try to use this merged DLL, however, I get [BadImageFormatException: Could not load file or assembly 'MyMergedDll' or one of its dependencies. An attempt was made to load a program ...

Unmanaged C++ template in managed C++ throws bad image?

I have a Managed C++ dll which dynamically links with an unmanaged C++ dll. The managed C++ derives several unmanaged classes from abstract interfaces in the unmanaged dll. This works fine. ---------- // uses macro __declspec(dllexport) class EXPORT_API ICustomer { public: virtual void PlaceOrder() = 0; // }; -----< LocalCustomer...

InstallUtill of GCC compiled exe recieving System.BadImageFormatException

I am trying to use a GCC compiled exe as a service in windows. From what I have researched I should do: C:\Windows\Microsoft.net\Framework\v2.0.50727\InstallUtil.exe [program name] Although when I try to do this I receive a message as such: Exception occurred while initializing the installation: System.BadImageFormatException: Could no...

Cannot access a Linux gcc compiled .so shared library from Windows Mono C# Project

Here's the setup: I've got a shared library (c++ with extern "C" methods) I've compiled in linux and created a library.so file. I've used Mono Develop on the same box (Ubuntu) and was able to DLLImport("library.so") and access my extern functions no problem. The problem comes in when I copied that .so file to a windows machine (Win7) ...

BadImageFormatException occurs only when Intellitrace configured for calls

I'm running VS 2010 Ultimate on 64 bit Windows 7. The application is compiled for x86. Intellitrace works fine with the default setting of events only. When I go to Debug | Options and turn on call information, then start a debugging session, I get a BadImageFormatException with this message: [R:\CfmDataMatch.exe] Invalid Typeref token...