0

How does the .net framework behave, if my application is a 64-Bit application (on a 64-bit windows server) but mixes x86 and x64 assemblies? Does it run as a full 64-Bit app? As far as i know does x64 and x86 differ in memory addressing and cpu instruction set.

Now the question, how does memory addressing works if mixing x64 and x86 assemblies and am i able to use more then 2GB ram in an x64 based application using not only x64 compiled assemblies?

Please comment if the question is unclear or if you need further information.

Thank you!

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
BendEg
  • 20,098
  • 17
  • 57
  • 131

1 Answers1

1

A Windows process can be 32 bit or 64 bit, it's determined by first assembly (your executable file) loaded. If it's AnyCPU then it'll be 64 bit on 64 bit systems and 32 bit on 32 bit systems (I omit Favor 32 bit for simplicity but you may safely consider that flag as an alias for x86, see also What is the purpose of the “Prefer 32-bit”).

Now the question, how does memory addressing works if mixing x64 and x86 assemblies and am i able to use more then 2GB ram in an x64 based application using not only x64 compiled assemblies?

A 64 bit process cannot load a 32 bit assembly so your question simply doesn't apply. If you try to load a 32 bit assembly you'll have a BadImageFormatException, that's all.

Moreover when you try to build you solution (mixing AnyCPU with x86 and x64) you also get a specific warning MSB3270.

Community
  • 1
  • 1
Adriano Repetti
  • 65,416
  • 20
  • 137
  • 208