1

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?

drb01
  • 189
  • 1
  • 2
  • 17
  • E+C is not heavily invested in doing nonsensical things. Like trying to re-initialize a global variable that was already initialized when the program was started. That cannot come to a good end. Also the *first* bullet in the [list of unsupported code changes](http://msdn.microsoft.com/en-us/library/0dbey757.aspx). You can simply use the debugger if this is necessary. – Hans Passant Dec 21 '14 at 16:25
  • "x" above was a local variable. The point is I can't make any changes no matter how trivial ... – drb01 Dec 21 '14 at 16:54
  • Well, that's not what the error message said. Expecting us to guess at what you really did is a very unproductive way to get help. – Hans Passant Dec 21 '14 at 16:57
  • Apologies, I have edited the post to show that it is a local variable. The point is that whatever I do, I get the same error message. I have used E+C a lot for years and always found it extremely helpful. I realise certain types of code changes don't work, and I wrote X=2 / x=1 to show that I was only making a very simple change, and E+C still doesn't work. – drb01 Dec 21 '14 at 17:39
  • 1
    The problem seems to be solved in VS2015 Community Edition – drb01 Aug 13 '15 at 17:05

2 Answers2

0

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!

Trezore
  • 11
  • 3
  • But it worked very well in VS2008 and earlier versions. So I don't see why it shouldn't work in V2013? – drb01 Dec 24 '14 at 17:06
  • I don't see why not either, but it's not. So hopefully Console Application CnE will be resolved for VS2013. Until then I await a MS Certified person to let me know. Thanks. I have VB6.0, VS2010, VS2012, and VS2013 installed. – Trezore Dec 26 '14 at 07:23
  • So you have the same problem? Does it work properly with vs2010 or vs2012? – drb01 Dec 26 '14 at 11:10
  • @drb01 I am thanking you here since I am unable to Thank you above! For the added update you posted "The problem seems to be solved in VS2015 Community Edition", I just installed VS2015 and will be testing that! Moderators: Still trying to increase my rep points! very frustrating! – Trezore Jul 12 '16 at 22:53
0

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];
}
  • Good thinking, but unfortunately that doesn't seem to help me. I tried editing the last few lines of a module and I still get the same problem.. – drb01 Jan 12 '15 at 12:23