Advertisement

Visual studio 2017 - edit and continue problem?

Started by September 29, 2018 11:00 AM
11 comments, last by Tom Sloper 5 years, 6 months ago

Hi!

I just upgraded to visual studio 2017 (c++) and cannot get "edit and continue" to work. So it tells me I need this setting enabled for "edit and continue".


Error		The 'Require source files to exactly match the original version' setting under Debug->Options->General needs to be enabled for Edit and Continue. Please check this option and try again.		Edit and Continue		

But if I enable this setting all breakpoints gets invalid ("this breakpoint will not be hit. The source code is different from the original version".

And to enable this for all breakpoints it tells me to enable the exact setting above (the one that needs to be OFF for edit and continue to work in the first place). How to work around this silliness?

Thanks!
Erik

If you are using Unreal, they do some compilation naughtiness that breaks edit and continue.

Unless you have some post-processing going on (or build interference like Unreal does) your binaries should be the same ones that Visual Studio has built, so they should be exactly the same as the ones the source was compiled with. There are several options that need to be set to ensure the correct debugging information is present as well as space for the system to inject the re-compiled code, but once those are set the system is a great time-saver.

The setting is required because the file starts out matching, you pause with a breakpoint then modify the file. The difference is compiled and injected into the executable through the dark arts.  Without the setting the compiler won't know which code you have modified during the breakpoint and which was modified at other times.

Advertisement

Hi! (im not using unreal engine).
But as stated the demand of VS seems logically circular:

The setting "require source files to exactly match the original original version". Needs to be enabled. It ALSO needs to be turned off.

This I cannot (nor any living man) do :)

It needs to be enabled, it is not contradictory. 

When debugging starts the file needs to exactly match.  When it is paused in the debugger the system double-checks that it matches.  Only after it has verified that they match, it allows you to make modifications while stopped in the debugger.  Those changes are patched in to the running executable.

I found out the issue: they have changed HOW you are allowed to edit your code.

Before I could change my code while running the game, then set a breakpoint: it would now realise the code is different and rebuild it (edit and continue). OR I could change it when already having gone into debugging.

NOW:
I must set a breakpoint FIRST. Then when in "paused mode" (stepping through code) Im allowed to change it, and it can rebuild. If I change before I go into step-though code mode it complains and forces me to restart the game entirely.

It seems like them have made their IDE worse... (less flexible). Or do I miss something?

18 minutes ago, suliman said:

Or do I miss something?

I can't remember ever being able to do as you described, changing while not being in a breakpoint/step-through mode.

Hello to all my stalkers.

Advertisement

I did it all the time in visual studio 2013. This is why I though it was bugged in it's entirety now (upgraded to 2017 last week)

I've never been able to edit-and-continue without suspending execution.  It doesn't need to be a breakpoint; you just need to have the program suspended in the debugger.

I wonder if you had a plugin that would suspend execution automatically when you started editing a file.

Suliman is correct. In previous versions, you could edit whilst the program was running, stop execution with a break, and then continue to trigger the on-the-fly recompile.

However, there is a workaround for this new annoyance. After making changes, use the pause button to pause execution. Then continue, and Edit and Continue will detect the changes and recompile. 

I wonder why they didnt make this automatic. Seems stupid as the old way of doing it was much better for me as a user.

This topic is closed to new replies.

Advertisement