locked
32 bit / 64 bit builds? RRS feed

  • Question

  • Hi there.

    I have started running Visual Studio 2008 under Vista x64 and I would like to convert my projects to 64 bit versions.

    However, some of the programs I create will also need to be installed on 32 bit architecture.

    I have several questions I need answering here:

    1. Is it possible within Visual Studio to create separate 32 and 64 bit 'release' builds - the files of which would get installed on the relevant machine?

    2. I am also getting Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor warnings for System.Data.dll and mscorlib.dll. 

    I have read elsewhere in the forum that I can reference the 64 bit versions of the DLLs ( but I presume I would need to keep the references looking at the 32 bit DLLs for compatibility)

    So for instance I could change the reference to System.Data.dll from C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll to C:\Windows\Microsoft.NET\Framework64\.....
    Monday, October 20, 2008 7:38 PM

Answers

  • You will get that warning when you set Project + Properties, Build tab, Platform Target to x64.  You should try very hard to keep the target set to Any CPU.  There are very few cases where you need to force the architecture.  Only when you have a dependency on an unmanaged DLL that is only available in a specific bitness.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Monday, October 27, 2008 11:21 AM
    Monday, October 20, 2008 10:18 PM
    Moderator
  • You need to be aware that if you are developing applications that utilise components that are 32bit-only then you do need to force the architecture to be x86 (32bit). However this should become evident pretty quickly when you try and run it ;)
    • Marked as answer by kevinjp Thursday, October 30, 2008 2:12 PM
    Wednesday, October 29, 2008 11:41 PM

All replies

  • You will get that warning when you set Project + Properties, Build tab, Platform Target to x64.  You should try very hard to keep the target set to Any CPU.  There are very few cases where you need to force the architecture.  Only when you have a dependency on an unmanaged DLL that is only available in a specific bitness.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Monday, October 27, 2008 11:21 AM
    Monday, October 20, 2008 10:18 PM
    Moderator
  • Thanks for clearing the issue, nobugz, I will make the change later. 
    Tuesday, October 21, 2008 10:44 AM
  • Did you know that the default setting for projects will target any platform.

    I use 64bit vista, I just build and send out dlls, I don't even think about the user being on 32bit or 64bit.

    Thats if I understand you problem.

    Thursday, October 23, 2008 4:02 PM
  • You need to be aware that if you are developing applications that utilise components that are 32bit-only then you do need to force the architecture to be x86 (32bit). However this should become evident pretty quickly when you try and run it ;)
    • Marked as answer by kevinjp Thursday, October 30, 2008 2:12 PM
    Wednesday, October 29, 2008 11:41 PM