Are there any considerations needed to be taken running your .net program on x64 vs x86?

后端 未结 7 1055
Happy的楠姐
Happy的楠姐 2021-01-17 11:05

I believe the architecture type (x86 vs x64) is abstracted away for you when making .Net programs, but are there any other considerations that can cause problems?

7条回答
  •  粉色の甜心
    2021-01-17 11:28

    From the MSDN doco, among other considerations:

    In many cases, assemblies will run the same on the 32-bit or 64-bit CLR. Some reasons for a program to behave differently when run by the 64-bit CLR include:

    • Structs that contain members that change size depending on the platform, such as any pointer type.

    • Pointer arithmetic that includes constant sizes.

    • Incorrect platform invoke or COM declarations that use Int32 for handles instead of IntPtr.

    • Casting IntPtr to Int32

    Also, default file locations.

提交回复
热议问题