<p>We are getting new dev machines and moving up to Vista 64 Ultimate to take advantage of our 8gb ram.  Our manager wants us to do all dev in 32bit virtual machines to make sure there will be no problems with our code moving into production.  </p>

<p>Is there any way to guarantee the resultant programs will work on 32bit os's? 
I don't mind using virtual machines, but I don't like how they force you back into a "Single" monitor type view.  I like moving my VS toolbars off to my other monitor.</p>

<p>EDIT:  We are using Visual Studio 2005 and 2008, VB.NET and/or C#</p>

<p>EDIT:  Using Harpreet's <a href="https://stackoverflow.com/questions/30543/is-code-written-in-vista-64-compatible-on-32-bit-os#30643">answer</a>, these are the steps I used to set my Visual Studio IDE to compile x86 / 32bit:</p>

<ol>
<li>Click Build and open Configuration Manager</li>
<li>Select Active Solution Platform drop down list</li>
<li>Select x86 if it is in the list and skip to step 5, if not Select <code>&lt;New...</code>></li>
<li>In the New Solution Platform dialog, select x86 and press OK</li>
<li>Verify the selected platform for all of your projects is x86</li>
<li>Click Close.</li>
</ol>

<p>Enjoy.  </p>

<p>Thank you,
Keith</p>

[{'answer_id': 30547, 'author': 'Adam Haile', 'author_id': 194, 'author_profile': 'https://Stackoverflow.com/users/194', 'pm_score': 1, 'selected': False, 'text': '<p>Compiling for a 64bit OS is an option in the compiler.  You can absolutely compile to a 32bit exe from within Vista 64 bit.  When you run the app, you can then see in the TaskManager that there is a "*32" next to the process...this means it\'s 32bit ;)</p>\n\n<p>I believe your managers need some more education on what 64bit OS really means :)</p>\n'}, {'answer_id': 30552, 'author': 'Grey Panther', 'author_id': 1265, 'author_profile': 'https://Stackoverflow.com/users/1265', 'pm_score': 2, 'selected': False, 'text': '<p>As long as you compile your executables as 32 bit, they will run on both 32 bit and 64 Windows machines (guaranteed). Using 64 dev machines has the advantage that you can start testing your code with 64 bit compilation (to check for things like pointers casted to 32 bit integers), this way making the transition to 64 bit easier in the future (should you  your company choose to do a 64 bit version).</p>\n'}, {'answer_id': 30555, 'author': 'wvdschel', 'author_id': 2018, 'author_profile': 'https://Stackoverflow.com/users/2018', 'pm_score': 1, 'selected': False, 'text': '<p>Not an answer to your question, but possibly a solution to your problem: VirtualBox (and probably others) supports "seamless integration" mode, which just gives you a second start bar and lets you drag windows around freely.</p>\n\n<p>Also, and this is an answer to your question, it depends on your compile settings. You can compile for different environments, and you can perfectly compile 32-bit programs on a 64-bit system with Visual Studio. Can\'t tell you how, but I\'m sure some Visual Studio guru could help you out.</p>\n'}, {'answer_id': 30564, 'author': 'Darren Kopp', 'author_id': 77, 'author_profile': 'https://Stackoverflow.com/users/77', 'pm_score': 0, 'selected': False, 'text': "<p>yeah, like adam was saying. There's 3 options: MSIL (default), x64, and x86. You can target x64 and it will generate dll's specifically for 64-bit systems, or you can do x86 which will run on 32-bit and 64-bit, but will have the same restrictions as 32-bit on a 64-bit system.</p>\n\n<p>MSIL will basically let the JITer issue the platform specific instruction (at a slight performance penalty compared to a native image)</p>\n\n<p><strong>EDIT</strong>: no language, so i'm talking about .net framework languages like vb.net and c#, c++ is a completely different animal.</p>\n"}, {'answer_id': 30643, 'author': 'Harpreet', 'author_id': 855, 'author_profile': 'https://Stackoverflow.com/users/855', 'pm_score': 4, 'selected': True, 'text': "<p>I do development on 64 bit machines for 32 bit Windows.  It's not a problem.  You should make sure that your projects are set to compile in x86 mode in order to be conservative. You'll want to go through each project in the solution and double check this.  You could also use the AnyCPU setting but that's a little riskier since it will run differently on your dev machine than a 32 bit machine.  You want to avoid the 64bit mode, of course. </p>\n\n<p>The problems I've run into are drivers that don't work when the app is compiled for 64 bit (explicitly 64 bit or AnyCPU compiled and running on 64 bit Windows).  Those problems are completely avoidable by sticking with x86 compilation.  That should reveal all flaws on your dev machines.</p>\n\n<p>Ideally, you could set up a build and test environment that could be executed against frequently on a 32 bit machine.  That should reassure your management and let you avoid the VM as your desktop.</p>\n"}, {'answer_id': 30682, 'author': 'Nick', 'author_id': 1236, 'author_profile': 'https://Stackoverflow.com/users/1236', 'pm_score': 1, 'selected': False, 'text': '<p>We develop a 32-bit application using VS 2005 (2008 soon) and have just purchased some new machines with XP Pro x64 or Vista Business 64-bit on them so that we can take advantage of the extra RAM whilst holding a watching brief on the possibility of doing a 64-bit port if it becomes commercially necessary to do so. We haven\'t had any problems with doing this other than tweaking some scripts in our development environment etc.</p>\n\n<p>Those developers who weren\'t included in this upgrade cycle still use 32-bit machines, so these should pick up problems when the unit tests and the application test suite are run as a matter of course before a check-in.</p>\n\n<p>What we also do is to make sure that we have a set of "test build" machines made up of "typical" configurations (XP/Vista, 2/4/8 cores, etc.) that build and test sets of check-ins - we have various different test suites for stability, performance, etc. - before they are added to the integration area proper. Again, these haven\'t picked up any problems with running a 32-bit application built on a 64-bit OS.</p>\n\n<p>Anyway, as others have already said, I wouldn\'t expect it to be a problem because it\'s the compiler that generates the appropriate code for the target OS regardless of the OS that the compiler is actually running on.</p>\n'}, {'answer_id': 272914, 'author': 'Keith Sirmons', 'author_id': 1048, 'author_profile': 'https://Stackoverflow.com/users/1048', 'pm_score': 0, 'selected': False, 'text': '<p>Found this today:</p>\n\n<p><a href="http://www.brianpeek.com/blog/archive/2007/11/13/x64-development-with-net.aspx" rel="nofollow noreferrer">http://www.brianpeek.com/blog/archive/2007/11/13/x64-development-with-net.aspx</a></p>\n\n<blockquote>\n  <p><strong>x64 Development with .NET</strong></p>\n  \n  <p>Earlier this year I made the switch to a 64-bit operating system - Vista Ultimate x64 to be exact.  For the most part, this process has been relatively painless, but there have been a few hiccups along the way (x64 compatible drivers, mainly, but that\'s not the point of this discussion).</p>\n  \n  <p>In the world of x64 development, there have been a few struggling points that I thought I\'d outline here.  This list will likely grow, so expect future posts on the matter.</p>\n  \n  <p>In the wonderful world of .NET development, applications and assemblies can be compiled to target various platforms.  By default, applications and assemblies are compiled as Any CPU in Visual Studio.  In this scenario, the CLR will load the assembly as whatever the default target is for the machine it is being executed on.  For example, when running an executable on an x64 machine, it will be run as a 64-bit process.</p>\n  \n  <p>Visual Studio also provides for 3 specific platform targets:  x86, x64 and Itanium (IA-64).  When building an executable as a specific target, it will be loaded as a process of that type.  For example, an x86-targeted executable run on an x64 machine will run as a 32-bit process using the 32-bit CLR and WOW64 layer.  When assemblies are loaded at runtime, they can only be loaded by a process if their target matches that of the hosting process, or it is compiled as Any CPU.  For example, if x64 were set as the target for an assembly, it can only be loaded by an x64 process.</p>\n  \n  <p>This has come into play in a few scenarios for me:</p>\n  \n  <ul>\n  <li><p>XNA - XNA is available as a set of 32-bit assemblies only.  Therefore, when referencing the XNA assemblies, the executable/assembly using them must be targeted to the x86 platform.  If it is targeted as x64 (or as Any CPU and run on a 64-bit machine), an error will be thrown when trying to load the XNA assemblies.</p></li>\n  <li><p>Microsoft Robotics Studio - The XInputGamepadService uses XNA internally to talk to the Xbox 360 controller.  See above.</p></li>\n  <li><p>Managed DirectX - While this is already deprecated and being replaced with XNA, it still has its uses.  The assemblies are not marked for a specific target, however I had difficulty with memory exceptions, especially with the Microsoft.DirectX.AudioVideoPlayback assembly.</p></li>\n  <li><p>Phidgets - Depending on what library you download and when, it may or may not be marked as 32-bit only.  The current version (11/8/07) is marked as such, and so requires a 32-bit process to host it.\n  The easiest way to determine if an executable or assembly is targeted to a specific platform is to use the corflags application.  To use this, open a Visual Studio Command Prompt from your Start menu and run it against the assembly you wish to check.</p></li>\n  </ul>\n  \n  <p>The easiest way to determine if an executable or assembly is targeted to a specific platform is to use the corflags application.  To use this, open a Visual Studio Command Prompt from your Start menu and run it against the assembly you wish to check.</p>\n</blockquote>\n'}]
['https://Stackoverflow.com/questions/30543', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1048/']