I'm trying to use the "Edit and Continue" feature in Visual Studio 2022, but it gives the warning "Code not able to compile" and then the following error:
'Debug.exe' in 'Base.cpp' was not linked with Edit and Continue enabled. Make sure that the Edit and Continue option (/EDITANDCONTINUE) is not ignored by the connector in the Error List window.
On the error screen, however, I did not see a warning that disables the /editandcontinue setting. I think I'm missing something in "Configuration Settings" but I couldn't find it. Also, the /ZI setting of the project and .cpp file is enabled.
I would be very grateful if you could help me solve this.
From this MS document, it mentions
Any incompatible compiler or linker settings will cause an error during Edit and Continue (for example, “’file.cpp’ in ‘MyApp.dll’ was not linked with Edit and Continue enabled. Ensure that /INCREMENTAL linking is enabled, and the /EDITANDCONTINUE directive is not ignored.”) ```.It indicates that your compiler's command options are not compatible.
Here’re suggestions you can check:
1 please check Requirements for C++ Edit and Continue
and make sure you meet those settings.
For example, Edit and Continue isn't really compatible with /Gm-, it requires "Enable Minimal Rebuild" (/Gm). You can refer above doc to check one by one.
2 check Incompatible settings and unsupported scenarios
.
3 enable logging when running into issues with EnC. And it helps diagnose EnC issues. From a Developer command prompt, run VsRegEdit.exe set “C:\Program Files (x86)\Microsoft Visual Studio[Version][YOUR EDITION]” HKCU Debugger NativeEncDiagnosticLoggingLevel DWORD 1
4 reset all environment settings to one of default collections of setting Tools->import and export settings->reset all settings.
BTW you can look at your Compiler command line and Linker command line (path: right click project->select properties) and provide it so that we can help you check.