为什么在Visual Studio x86和一个WPF应用程序不会值为anycpu默认平台的目标? [英] Why is the default platform target for a WPF applications in Visual Studio x86 and not AnyCPU?

查看:872
本文介绍了为什么在Visual Studio x86和一个WPF应用程序不会值为anycpu默认平台的目标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Visual Studio 2012中的目标平台一个新的WPF应用程序,并建立配置,默认设置为86。为什么会出现这样的情况?对于一个普通的WPF应用程序(不包括混合模式程序集的任何引用)是有使用值为anycpu任何危险,所以我的WPF的可执行文件会被JIT编译到x64 code我的x64机器上到x86计算机在x86上?


解决方案

  

为什么会出现这种情况?


对于大多数应用程序,如建设32位实际上是更好的。 64位提供一些好处,而且在大多数情况下,一些显著缺点(高得多的内存使用情况,更复杂的依赖关系管理,多平台,更糟糕的调试经验,等等)。

不过,如果你的应用程序的需求的是能够使用大量的内存,那么当然64位具有优势(并很容易在VS切换),但大多数应用程序不落入此船。

这就是为什么在VS 2012中新的默认值是使用值为anycpu prefer32Bit 而不是值为anycpu 为应用程序。

When I create a new WPF application in Visual Studio 2012 the platform target and build configuration is set to x86 by default. Why is this the case? For a plain WPF application (without any references to mixed mode assemblies) is there any danger using AnyCPU so my WPF executable will be JITed to x64 code on my x64 machine and to x86 on a x86 machine?

解决方案

Why is this the case?

For most applications, building as 32bit is actually better. 64bit provides few benefits, and some significant disadvantages in most cases (much higher memory usage, more complex dependency management with multiple platforms, worse debugging experience, etc).

If, however, your application needs to be able to use large amounts of memory, then of course 64bit has advantages (and is easy to switch in VS), but most applications do not fall into this boat.

This is why the new default in VS 2012 is to use AnyCPUPrefer32Bit instead of AnyCPU for applications.

这篇关于为什么在Visual Studio x86和一个WPF应用程序不会值为anycpu默认平台的目标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆