32bit/64bit problems

Oct 23, 2014 at 12:13 AM
Hello again,

Im having some issues on a 64-bit machine.

The ONLY way i can get this configuration to work at the moment, is to have do a DEBUG build with everything set to "Any CPU". With this configuration my hosting process is 64bit, and the hosted process compiles to 64bit, running as expected.

If i change to RELEASE, with the same "Any CPU" settings, my hosting process becomes 32bit and the hosted process compiles to 64bit resulting in a badimageformat exception. So ive tried to find a way to specifically set the compilation of the hosted process'es bit'ness -- without luck?

Im wondering if this is supported? I dont see it being a big issue to detect and switch compilers.

That said, i also understand it might be a lack of knowledge on my part. This is a windows service, compiled against .net4, originally installed as 32bit (x86 program files), on a 64bit machine. I am simply replacing it, by deleting and copying this new build. This might explain the differences in behaviour i am seeing between DEBUG and RELEASE outputs, as its my understanding this shouldnt at all effect the bit'ness.
Oct 23, 2014 at 2:34 PM
Edited Oct 23, 2014 at 2:34 PM
Have you tried using the PlatformTarget flag in ProcessDomainSetup to specifically have the hosting process target x64?
Oct 30, 2014 at 11:50 PM
shakes head

i looked through all these i swear.
ProcessDomainSetup.Platform = PlatformTarget.x86 | PlatformTarget.x64 | PlatformTarget.AnyCPU | PlatformTarget.Itanium
incase anyone else is looking for it.