Changes to 64-bit applications are not allowed的解决方法

简介:

最近开始使用Windows 7 x64了。终于可以使用更大的内存。同时也带来了问题,Visual Studio 2010调试程序时,修改出错“Changes to 64-bit applications are not allowed”。下面是解决方法:

 

One of the most popular features in the Visual Studio debugger is the ability to edit code during a debug session and have the changes apply without having to stop the debugger, recompile the application and then run the application to verify the changes. This feature is affectionately known as "Edit and Continue" or "E&C" for short.

Unfortunately, Edit and Continue isn't supported on 64-bit. In fact, if you try to use Edit & Continue when debugging a 64-bit application, you get the following error message: "Changes to 64-bit applications are not allowed", as shown below.

Edit and Continue dialog

Many users may not be aware that by default, when you create a C# or VB project in Visual Studio 2008, the "Platform" for the project is set to "Any CPU". This means that if you run your application on a 32-bit operating system, your application will run as a 32-bit process and similarly, if you run your application on a 64-bit operating system, the application will be 64-bit. The consequence of "Any CPU" is that when you try to debug your application on a 64-bit operating system, you won't be able to use the Edit and Continue feature.

However, there is a workaround. During development, you can set the Platform for your project to 32-bit which means that your application will run as a 32-bit process even on a 64-bit operating system. This is known as WOW64 or "Windows On Windows" which basically means that you can run a 32-bit application on a 64-bit operating system.

So, how do you set the Platform for your project to 32-bit? Well, you need to create a 32-bit platform using the Visual Studio Configuration Manager. Here is a short walkthrough.

First, open the "Configuration Manager" dialog from Build –> Configuration Manager. The Configuration Manager dialog is shown below.

Configuration Manager

On the Configuration Manager dialog, select "New..." from the "Active solution platform" dropdown, as shown here.

Create New Platform

On the "New Solution Platform" dialog, select "x86" and press the OK button.

New Solution Platform dialog

That's it! Your project is now compiled as a 32-bit application and therefore, it also runs as a 32-bit process.

An important note to remember is that if you are planning to deploy your application to a 64-bit machine and you want the application to run as a 64-bit process, don't forget to set the project platform back to "Any CPU" and compile the project.

 

注意,在"New Solution Platform" dialog中不要勾选“Create new project platforms”,否则可能出错。










本文转自 h2appy  51CTO博客,原文链接:http://blog.51cto.com/h2appy/1029986,如需转载请自行联系原作者
目录
相关文章
运行JProfiler:ERROR: Invalid license key. Aborting
运行JProfiler:ERROR: Invalid license key. Aborting
442 0
运行JProfiler:ERROR: Invalid license key. Aborting
|
6月前
Cannot find a valid license key for ISIS Professional on this computer . this license Manager report
Cannot find a valid license key for ISIS Professional on this computer . this license Manager report
|
7月前
|
Java 定位技术 Android开发
安装apk显示 requires unavailable shared library com.xxx
安装apk显示 requires unavailable shared library com.xxx
92 0
|
7月前
|
编译器 Linux 开发工具
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools
82 0
MAC编译OpenJDK8:error: invalid argument ‘-std=gnu++98‘ not allowed with ‘C‘
MAC编译OpenJDK8:error: invalid argument ‘-std=gnu++98‘ not allowed with ‘C‘
110 0
AS 3.6 之前和之后No cached version available for offline mode 解决方法
AS 3.6 之前和之后No cached version available for offline mode 解决方法
155 0
AS 3.6 之前和之后No cached version available for offline mode 解决方法
|
Java Android开发
is not allowed for source level below 1.7 的解决办法
is not allowed for source level below 1.7 的解决办法
211 0
|
iOS开发
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun ...
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun image.png 解决方法: 打开终端输入 xcode-select --install 回车后,系统弹出下载xcode,点击确认,下载完成后即可。
1703 0