Visual Studio 2013 编辑并继续不起作用

使用 VS2013 Pro 时,我无法在调试 MFC 程序时使用编辑并继续".我创建了一个新的 MFC 项目进行测试.

With VS2013 Pro I am not able to use "Edit and Continue" when debugging an MFC program. I created a new MFC project to test.

操作系统是 Windows 7 64 位,我运行的是 Visual Studio 2013 12.0.30110.00 Update1.

OS is Windows 7 64-bit and I'm running Visual Studio 2013 12.0.30110.00 Update1.

Tools->Options->Debugging->Edit and Continue 下,我勾选了 Enable Edit and Continue.我已经取消选中并选中它,但是每当我在调试时修改代码时,我都会收到以下消息:

Under Tools->Options->Debugging->Edit and Continue I have Enable Edit and Continue checked. I have unchecked it and checked it, but whenever I modify the code while debugging I get the following message:

源文件已更改.它不再与用于构建正在调试的应用程序的文件版本匹配.

The source file has changed. It no longer matches the version of the file used to build the application being debugged.

基本上我没有改变任何设置,除了标签大小,我已经将键盘映射方案设置为 VC6.

Basically I haven't changed any settings except for the tab sizes and I've set the keyboard mapping scheme to VC6.

我缺少什么设置才能启用编辑和继续?

推荐答案

默认情况下对本机代码禁用编辑并继续".启用:

Edit and Continue is disabled for native code by default. To enable:

  1. 在工具菜单上,点击选项.
  2. 在选项对话框中,打开调试节点,然后选择编辑并继续类别.
  3. 在仅限本机选项组中,选择启用本机编辑并继续
  1. On the Tools menu, click Options.
  2. In the Options dialog box, open the Debugging node, and select the Edit and Continue category.
  3. In the Native-only options group, select Enable native Edit and Continue

编辑:测试本机编辑并继续"的步骤是否有效:

Edit: Steps to test native Edit and Continue is working:

  1. 开始 VS 2013
  2. 创建一个新的 MFC 项目:
    • FILE->新建项目->MFC 应用程序->确定.
    • 在 MFC 应用程序向导中选择完成.
  1. Start VS 2013
  2. Create a new MFC project:
    • FILE->New Project->MFC Application->OK.
    • Select Finish on the MFC Application Wizard.
  • 构建->构建解决方案
  • 调试->开始调试
  • 调试->打破一切
  • 打开 OutputWnd.cpp 并找到 COutputWnd::OnSize(第 80 行)
  • 在函数的开头插入这一行:cx = cx/2;
  • 调试->继续

相关文章