Problem running studio.net application in 64

normski99

New Member
Hi,
First time here, and it's to try to get a problem solved.
I have various applications which I sell. Written in Visual Studio.net some in 2003, and some in 2008 versions. However the problem is the same with both.
The applications have been running successfully on Vista 32 bit, but with Vista 64 bit, this error message appears when the user tries to start the program:

Runtime error:
An unhandled error has occurred.
"An attempt to load a program with an incorrect format, (Exception from HRESULT:0x8007000B)"

If the problem persists, please contact your software supplier.

I would appreciate any advice / information about this.

Norm

 

My Computer

More info about the architecture of your apps would be useful.

In this context, 0x8007000B (facility=Win32, error=0n11) usually means you're trying to load a 64-bit binary into a 32-bit process, or vice versa. As you're probably aware, 64-bit Windows can run either 64-bit or 32-bit code, but any given process must be entirely composed of either 32-bit or 64-bit binaries, except for the thunking layer (wow64.dll, wow64cpu.dll...).

If your apps are managed code (reliant on the CLR and the .Net framework), they'll run as 32-bit on a 32-bit OS, and 64-bit if moved over to a 64-bit box. That's a problem in a scenario where you've also got a 32-bit DLL which is unmanaged and which you're trying to load into your process. That'll work fine on a 32-bit platform, because both the managed and unmanaged portions of the app are 32-bit, but when you move the same setup over to a 64-bit box the managed stuff now automagically becomes 64-bit and it can no longer load a 32-bit native component into its process.

If that's you, there are several ways to resolve the issue, depending on your exact needs. Check out the CORflags utility - MSDN has lots of info on how to use it to tag your managed code to always run as 32-bit, even on a 64-bit platform. A more complex alternative, which is apt under some circumstances, is to provide separate 32-bit and 64-bit binaries for the (compiled) native component.
 

My Computer

Hi,
Thanks for that information.. I'm not a proper computer person, just a writer with a knack, so a lot of what you said missed me completely. However, one thing that stands out is '32-bit DL'. I use copy protection which I do believe has some cm.dll files in there somewhere. So I'll get our copy protection provider to check it out.
Regards
Norm
 

My Computer

Hi,
Thanks for that information.. I'm not a proper computer person, just a writer with a knack, so a lot of what you said missed me completely. However, one thing that stands out is '32-bit DL'. I use copy protection which I do believe has some cm.dll files in there somewhere. So I'll get our copy protection provider to check it out.
Regards
Norm

Sorry, when talking to someone who actually develops code there's always that fine line between too much and too little complexity in an explanation.

Simpler version: your code is of a variety termed "managed", and it automatically becomes either 32-bit or 64-bit to match the platform it's running on at the time. The cm.dll file is different. It's "unmanaged" and fixed at 32-bit, and that means it cannot be loaded by your app while it's in its 64-bit guise (on a 64-bit platform). Although 64-bit Windows can run either 32-bit or 64-bit code, it's impossible to mix the two types in a single program (process).

The two solutions I mentioned involve either marking your code so that it always runs as 32-bit, even on a 64-bit plaform, so that it can always load the 32-bit cm.dll, or asking the copy protection provider for both 32-bit and 64-bit versions of cm.dll so that the platform-appropriate one can be used on a given system (that's the more complex solution).

Good luck with it.
 

My Computer

Phew! That's better :-)
I passed your first post onto my technical bloke, and I'll send this one along also..
If you ever need to know anything about Plumbing, Central Heating, and Gas, give me a shout..
Thanks for your help
Norm
 

My Computer

Hello again H2SO4.
Thanks to you things are well on the way to being sorted. I sent copies of your information to my coding person and he gave me a 32 bit and a 64 bit version of our software, each of which ran successfully on Vista 64 bit. However, I then applied our (bought in) copy protection.. And it no longer worked! So I have now passed it onto the Protection people (copyminder.com) who hadn't realised that there was a problem.
Thanks for all your help..
I see your in Aus.... I'm nipping across to Melbourne in Jan for a couple of weeks.. I'll give you a wave as I fly over :-)
Regards
Norm
 

My Computer

Back
Top