John A Grandy wrote:
No this has nothing to do with image ( .img ) files. I am not working with
any images.
"Atul Rane" <At******@discu ssions.microsof t.comwrote in message
news:F5******** *************** ***********@mic rosoft.com...
>>
"John A Grandy" wrote:
>>VS2005 ( all updates ) on XP ( all updates )
I have a solution with many projects and a substantial reference tree.
I have a Windows Application project that will build but not run. It
fails
in Program.cs when it attempts to invoke the form class :
Application.R un( new Form1() );
BadImageForma tException was unhandled
Could not load file or assembly 'MyApi, Version=1.0.0.0 , Culture=neutral ,
PublicKeyToke n=null' or one of its dependencies. An attempt was made to
load
a program with an incorrect format.
The strange thing is that other Windows Applications that contain a
reference to the MyApi assembly run just fine.
I clean and rebuild to no avail. Also, removing/adding ref does not
help.
What could be going on ?
Hi john,
I think the problem is in your image which is you trying to open, try to
open different image file.
In general, this exception happens when a dependent is not correct in
the current OS platform.
For example, in 64 bit OS, a dotnet2 app loads a native 32bit DLL. (64
bit app cannot load 32 bit DLL).
Since, no info about what is the platform the problem happens, cannot
confirm is this case.
Note about that, for dotnet2 app, the will run as 64 bit app in 64 bit
OS, except the developer directly mark it is 32bit only. Otherwise, the
64 bit main exe cannot load any 32bit DLL, include the DLL which uses
managed C++ and it calls the win API, or other natvie C 32bit DLL.
--
Jacky Kwok
jacky@alumni_DO T_cuhk_DOT_edu_ DOT_hk