Eddy
Eddy

Reputation: 31

How to restore the default settings for the Visual Studio 2010 Configuration Manager

After some "games" with the Visual Studio Configuration Manager I found that every new C#/VB.NET project I create in my Visual Studio only has the 'x86' solution platform. It should be 'Any CPU', and I should be able to choose x86 or x64 if required. How do I reset these settings for all new projects?

Upvotes: 3

Views: 8526

Answers (2)

Danny Tuppeny
Danny Tuppeny

Reputation: 42433

Microsoft changed the default for EXE's to x86. Check out this post by Rick Byers:

http://blogs.msdn.com/b/rmbyers/archive/2009/06/09/anycpu-exes-are-usually-more-trouble-then-they-re-worth.aspx

Here's the list I've been using in our discussions to justify making x86 the default for EXE projects in Visual Studio:

  • Running in two very different modes increases product complexity and the cost of testing * Often people don't realize the implications on native-interop of architecture-neutral assemblies. It means you need to ensure that equivalent 32-bit and 64-bit versions of the native DLLs you depend on are available, and (most significantly) the appropriate one is selected automatically. This is fairly easy when calling OS APIs due to the OS re-mapping of c:\windows\system32 to c:\windows\syswow64 when running in the WOW and extensive testing the OS team does. But many people who ship native DLLs alongside their managed app get this wrong at first and are surprised then their application blows up on 64-bit systems with an exception about their 32-bit DLL being in a bad format. Also, although it's much rarer than for native-code, pointer-size bugs can still manifest in .NET (eg. assuming IntPtr is the same as Int32, or incorrect marshalling declarations when interopping with native code). * Also, in addition to the rules you need to know to follow, there's just the issue that you've now really got twice as much code to test. Eg., there could easily be (and certainly have been many) CLR bugs that reproduce only on one architecture of the CLR, and this applies all the way across the stack (from OS, framework, 3rd-party libraries, to your code). Of course in an ideal world everyone has done a great job testing both 32-bit and 64-bit and you won't see any differences, but in practice for any large application that tends not to be the case, and (at Microsoft at least) we end up duplicating our entire test system for 32 and 64-bit and paying a significant ongoing cost to testing and supporting all platforms. * [Edit: Rico - of CLR and VS performance architect fame - just posted a great blog entry on why Visual Studio will not be a pure 64-bit application anytmie soon]
  • 32-bit tends to be faster anyway * When an application can run fine either in 32-bit or 64-bit mode, the 32-bit mode tends to be a little faster. Larger pointers means more memory and cache consumption, and the number of bytes of CPU cache available is the same for both 32-bit and 64-bit processes. Of course the WOW layer does add some overhead, but the performance numbers I've seen indicate that in most real-world scenarios running in the WOW is faster than running as a native 64-bit process
  • Some features aren't avaiable in 64-bit * Although we all want to have perfect parity between 32-bit and 64-bit, the reality is that we're not quite there yet. CLR v2 only supported mixed-mode debugging on x86, and although we've finally added x64 support in CLR V4, edit-and-continue still doesn't support x64. On the CLR team, we consider x64 to be a first-class citizen whenever we add new functionality, but the reality is that we've got a complicated code-base (eg. completely separate 32-bit and 64-bit JIT compilers) and we sometimes have to make trade-offs (for example, adding 64-bit EnC would have been a very significant cost to the JIT team, and we decided that their time was better spent on higher priority features). There are other cool features outside of the CLR that are also specific to x86 - like historical debugging in VS 2010. Complicating matters here is that we haven't always done a great job with the error messages, and so sometimes people "upgrade" to a 64-bit OS and are then disgusted to see that some of their features no longer appear to work (without realizing that if they just re-targetted the WOW they'd work fine). For example, the EnC error in VS isn't very clear ("Changes to 64-bit applications are not allowed"), and has lead to some confusion in practice. I believe we're doing the right thing in VS2010 and fixing that dialog to make it clear that switching your project to x86 can resolve the issue, but still there's no getting back the time people have wasted on errors like this.

Upvotes: 1

Uri Cohen
Uri Cohen

Reputation: 3608

Are you sure this is the problem? Maybe you should just set "Show Advanced Build Configurations" as detailed here.

Upvotes: 0

Related Questions