VS2013: Edit and Continue no longer works since upgrading from VS2008

573 views Asked by At

I have just upgraded my fairly large MFC application from VS2008 to VS2013 Professional. After some minor tweaks everything works except Edit and Continue. E.g. after breaking, I change a code line "x=2" to "x=1" where x is a local variable. On continuing I get the following error:

"A global or static variable was added, renamed, removed, or changed data type or initialization: ___ImageBase (referenced by: c:\temp\vs2013 (2014_12_20)\process\debug\jlglob.obj)"

To get EnC to work at all I had to go to Tools->Debugging->Edit and Continue, and enable "Enable native Edit and Continue". I am not sure what this does, but without it checked all I ever got was a warning saying "The source file has changed..." but it made no attempt to recompile.

I have checked the obvious settings:

  • disabled all optimisation

  • set "Program Database for Edit and Continue /ZI"

  • not using Precompiled Headers

  • /SAFESH:NO

  • Platform Toolset - Visual Studio 2013 (v120)

  • WinVer = 0x0601

  • I have deleted all intermediate file directories, including .tlog files.

It was a clean installation of VS2013, not taking the settings from the VS2008 installation. Any idea what the problem could be?

2

There are 2 answers

4
Trezore On

Not only does E+C not work for simple formula, it won't even allow any typing what so ever. There seems to be no solution at all at this time. Using a basic Console Application here. Set .NET Framework to 4.5.1 as has been suggested in many posts found. And all the enabling/disabling settings mentioned thus far... To no avail.

In conclusion, the solution is there is no solution!

1
UFitzit On

This started happening just recently in a project I am working on in V2010, I'd never had this before excepting where it was a legitimate case.

Eventually I tracked it down to a static initialized list I had declared below the point where I was editing. Usually I put these at the top of my code but in this case I'd been lazy and put it inline with my functions. It appears that every time I made and edit and continue to code above the static list that caused a shift in its line it would cause this error. Shifting the static list inside the function had the same issue.

Moving the static list to the top of my code fixed the edit and continue issue.

void DoSomething()
{
 int i = 1;
 //Adding a line in here changes the line of the static list below and cause the error.
}

static char* somedata[] = 
{
 "d1",
 "d2",
};

char* GetSomeData(int nIndex)
{
 return somedata[nIndex];
}