I'm currently trying to configure Visual Studio to automatically set up the appropriate configurations for 32-bit and 64-bit compilation.
Ideally, I'd like to be able to have Visual Studio automatically show x64 as a platform under the Configuration Manager.
How can I configure VS so any new project I create has this?
Thanks!
From the BUILD menu in Visual Studio, select Configuration Manager. From the Active solution platform drop-down list, select New. The New Solution Platform dialog displays. In the Type or select new platform combination box, select x64.
Visual Studio enables you to set up your applications to target different platforms, including 64-bit platforms. For more information on 64-bit platform support in Visual Studio, see 64-bit applications. Visual Studio 2022 on Windows is now a 64-bit application.
From the Visual Studio menu, choose Test, then choose Processor Architecture for AnyCPU projects. Choose x64 to run the tests as a 64-bit process.
In the Configuration drop-down list for that project, choose New. The New Project Configuration dialog box opens. In the Name box, enter a name for the new configuration. To use the property settings from an existing project configuration, in the Copy settings from drop-down list, choose a configuration.
Visual Studio 2010 and 2008 both provide a way to do this.
Project Templates
are used by VS to create new projects. These templates can be copied and updated as alternate versions or the originals can even modified in place. You can either use the VS editor to modify the Project Template or you can do it manually; it's your choice:
To use the Visual Studio editor:
File -> Export Template
To dig into the Project Template files yourself:
Project Template files are stored here: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates
An example is the Windows Forms Application project template, which is housed in this ZIP file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Windows\1033\WindowsApplication.zip
The ZIP file contains a handful of files that form the structure of the project (ie: form1.cs) and contain templatized versions of what you get when you create a project of this type.
The important file you'll want to modify is: windowsapplication.csproj
. The name of the file will be different for each template, but the .csproj will remain consistent. It is the templatized project file, so modifying this will modify the project settings for all future projects made from this template.
To modify it, simply extract it from the ZIP, make your changes, then put it back into the ZIP file, overwriting the existing one.
In all cases, the result will be:
Now, when you create a new project of that type in the future, just pick YOUR template instead of the default one and you'll have x64 as a Configuration. You can even share the configuration with your friends since it's stored as a ZIP file.
This MSDN page documents the steps needed for 2010. Click "Other Versions" at the top of that page to see the instructions for VS 2008:
http://msdn.microsoft.com/en-us/library/ms185319(v=VS.100).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With