none
Any nuances on running code on x64 bit RRS feed

  • Question

  • HI , 
    I have 2 applications ( ASP & WCF ) which were developed on x32 XP machine ( .net 3.5 sp1 ) . Target platform was ANY CPU . 
    Now they are running on windows server 2003 x86 . 

    I want to migrate to windows server 2008 x64 .  Do I need to recompile it or do something else ? 
    Why not always not to choose ANY CPU and don't care about target platform ? I know that it could be important for COM interop , if there is another issues ? 

    Thanks ! 

      
    Wednesday, December 9, 2009 7:33 PM

Answers

  • Hi,

    Here are some choices for us if we want to migrate a .net application from 32-bit system to 64-bit system:

    1. If the application is built as Any CPU , we need to make sure that all dependency dlls have corresponding 64-bit version, because the application is running as 64-bit application, it can only load 64-bit dll.
    1. If we cannot find 64-bit version for one or more dependency dlls, we can build the application as X86 , with the help of WoW64 (Windows on Windows64) technology, our application will work as 32-bit application in 64-bit system. 

     

    Thanks,

    Eric


    Please remember to mark helpful replies as answers and unmark them if they provide no help.
    • Marked as answer by Leonid R Friday, December 11, 2009 12:59 PM
    Friday, December 11, 2009 9:23 AM
  • When you compile your application you emit Intermediate language code which is compiled to machine language code at runtime. The machine code produced depends on your processor and operating system (this is one of the main benefits of compiling through an intermediate language), so if you are running your application in 32bit environment it will compile to 32bit machine code, if you are running in 64bit environment it will compile to 64 bit code. This scenario is broken if you force a target compilation when you are building your application.

    So if you are not referencing any unmanaged code assemblies then every thing will work fine automatically, but if you do you will need to check that those assemblies have 64 bit versions deployed with the application.
    • Marked as answer by Leonid R Sunday, December 13, 2009 12:38 PM
    Sunday, December 13, 2009 6:29 AM

All replies

  • Hi,

    Here are some choices for us if we want to migrate a .net application from 32-bit system to 64-bit system:

    1. If the application is built as Any CPU , we need to make sure that all dependency dlls have corresponding 64-bit version, because the application is running as 64-bit application, it can only load 64-bit dll.
    1. If we cannot find 64-bit version for one or more dependency dlls, we can build the application as X86 , with the help of WoW64 (Windows on Windows64) technology, our application will work as 32-bit application in 64-bit system. 

     

    Thanks,

    Eric


    Please remember to mark helpful replies as answers and unmark them if they provide no help.
    • Marked as answer by Leonid R Friday, December 11, 2009 12:59 PM
    Friday, December 11, 2009 9:23 AM
  • When you compile your application you emit Intermediate language code which is compiled to machine language code at runtime. The machine code produced depends on your processor and operating system (this is one of the main benefits of compiling through an intermediate language), so if you are running your application in 32bit environment it will compile to 32bit machine code, if you are running in 64bit environment it will compile to 64 bit code. This scenario is broken if you force a target compilation when you are building your application.

    So if you are not referencing any unmanaged code assemblies then every thing will work fine automatically, but if you do you will need to check that those assemblies have 64 bit versions deployed with the application.
    • Marked as answer by Leonid R Sunday, December 13, 2009 12:38 PM
    Sunday, December 13, 2009 6:29 AM