Visual Studio 2013 Edit and Continue not working

╄→гoц情女王★ 提交于 2019-12-09 03:16:55

问题


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.

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

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.

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

What setting am I missing to enable edit and continue?


回答1:


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

  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. Start VS 2013
  2. Create a new MFC project:
    • FILE->New Project->MFC Application->OK.
    • Select Finish on the MFC Application Wizard.
  3. Build and start debugging:
    • BUILD->Build Solution
    • DEBUG->Start Debugging
  4. Break into the program:
    • DEBUG->Break all
  5. Make a code change:
    • Open OutputWnd.cpp and find COutputWnd::OnSize (Line 80)
    • Insert this line at the start of the function: cx = cx / 2;
  6. Continue execution:
    • DEBUG->Continue
  7. Resize the application window to see the effect of the code change on the Output pane at the bottom. Its width should be half the required size.



回答2:


Edit and continue is also a Setting for each project.

  1. It must be set in the compiler options under C++ -> General -> Debug Information Format: "Program Database for Edit And Continue (/ZI)"
  2. Also the linker settings must be changed. The linker has to use incremental linking. Linker -> General -> Enable Incremental Linking = Yes or (for VC 2012 users) C++ -> All Options -> Enable Function-Level Linking = Yes (/Gy)

For more information read the MSDN.




回答3:


The last hint helped, but we had to

set "Image Has Safe exception handlers" = NO(/SAFESEH:NO)

in all projects of our solution!




回答4:


I did all steps described above, but nothing helps (thanks all for it).

My solution was:

Project -> Properties -> Linker -> Advanced:

set

"Image Has Safe exception handlers" = NO(/SAFESEH:NO)

Apply, Ok, and Rebuild project.

Hope it helps.




回答5:


For what it's worth I've been pulling my hair out on this one as well. I finally got edit and continue working by changing the following setting:

Project > Properties > Linker > All Options > "image has safe exception handlers".

It was set to No (/SAFESEH:NO). I went in and deleted it. I didn't set it to YES, or NO. I simply kept it blank. I would love to know what it means to be blank. But edit and continue is now working for me. Maybe it will help for you.




回答6:


A project with a "Release Configuration" will disable Edit and Continue.

To change this

  1. Open "Configuration Manager"
  2. Change Configuration for the project from Release to Debug
  3. Rebuild and debug project



回答7:


Edit and Continue will also not work if your project's Platform Toolset is set to Visual Studio 2012 (v110), instead of the usual Visual Studio 2013 (v120).

This setting is in Project > Configuration Properties > General > Platform Toolset.




回答8:


The solution of this problem is on the Microsoft Documentation...

If IntelliTrace is enabled and you collect both IntelliTrace events and call information, Edit and Continue is disabled.

On Visual studios' menu go on Tools>>options - Select "IntelliTrace" tab and let IntelliTrace events only checked.. Save, restart the visual studio and.......

Your Edit and Continue will work again!



来源:https://stackoverflow.com/questions/22329988/visual-studio-2013-edit-and-continue-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!