dcsimg
Results 1 to 7 of 7

Thread: 32bit snd 64bit OS

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2012
    Posts
    193

    32bit snd 64bit OS

    I am building an app on 64bit win7. i havent tried since i dont have other pc but, will the app built on 64bit os will run on 32bit and vice versa ?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    40,283

    Re: 32bit snd 64bit OS

    It doesn't matter what OS you use... your Project options specify whether to compile to 32-bit or 64-bit (or a "decide at runtime" mixture).

    You can specify x86 (32 bit) or x64 (64 bit) or AnyCPU (decide at runtime).


    AnyCPU is probably fine in most cases, but some things only work as 32-bit (such as using a database via JET), and some thing only as 64-bit.


    Note that with a 64-bit OS you can run 32-bit and 64-bit programs.

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    32,623

    Re: 32bit snd 64bit OS

    It would be safest to go with x86. The AnyCPU option can make some poor choices in some cases, especially if it is looking for other resources. For example, if you use AnyCPU with the JET database engine, it will look for a 64 bit engine on 64 bit systems, but there isn't one. You might hope it would then look for a 32 bit engine. Instead, it just fails. So, at this time, the safest thing is x86, though it depends on what your application needs to have with it.
    My usual boring signature: Nothing

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    100,383

    Re: 32bit snd 64bit OS

    The default for a Windows Forms Application project in VS 2017 is to target AnyCPU with the 'prefer 32-bit' flag set. That is much the same as targeting x86 and I've never actually seen a proper description of the difference. It may just be that the end result is the same.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    Fanatic Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    875

    Re: 32bit snd 64bit OS

    Quote Originally Posted by jmcilhinney View Post
    The default for a Windows Forms Application project in VS 2017 is to target AnyCPU with the 'prefer 32-bit' flag set. That is much the same as targeting x86 and I've never actually seen a proper description of the difference. It may just be that the end result is the same.
    AnyCPU would run as a 32bit application on a 32bit OS and as a 64bit application on a 64bit OS, the prefer 32 bit means it will will run as 32bit on both a 32bit or 64bit OS assuming there is 32bit support - a 64bit os without 32bit support would result in the application then running as 64bit.

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    100,383

    Re: 32bit snd 64bit OS

    Quote Originally Posted by PlausiblyDamp View Post
    a 64bit os without 32bit support would result in the application then running as 64bit.
    I did think of that but second-guessed myself because I wasn't sure whether such a thing existed. Maybe some editions of Windows Server are like that or maybe it's just for theoretical support.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  7. #7
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,580

    Re: 32bit snd 64bit OS

    "Prefer 32-bit" has a stupid name. It's really the "allow ARM support" flag, if I understand it properly.

    So if you need to compile for one of the very rare WinRT devices, you need that flag. Maybe Xamarin Projects use it, I don't know.

    Generally it's sad that 10+ years later, in a market where it's hard to even buy x86 machines, we still have to carefully make sure most of our projects target x86 instead of x64. Thanks, bargain-bin native developers.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width