views:

4004

answers:

9

Hello,
Even if I create a clean WinForms project, Edit and Continue doesn't work and gives me the error mentioned above.

  1. Edit and Continue option is checked in Tools -> Options -> Debugging.
  2. Optimization is not enabled.
  3. Seems like there is no any managed profiler set up.
  4. I am running in Debug mode
  5. I am running on x64 CPU and Windows XP 32-bit, but setting platform target to x86 rather than AnyCpu doesn't help.
  6. Repairing Visual Studio installation doesn't help.

I also found this article on MSDN website: http://msdn.microsoft.com/en-us/library/ms164927(VS.80).aspx :

Unsupported Scenarios

Edit and Continue is not available in the following debugging scenarios:

  • Debugging on Windows 98.

  • Mixed-mode (native/managed) debugging.

  • SQL debugging.

  • Debugging a Dr. Watson dump.

  • Editing code after an unhandled exception, when the "Unwind the call stack on unhandled exceptions" option is not selected.

  • Debugging an embedded runtime application.

  • Debugging an application with Attach to rather than running the application with Start from the Debug menu.

  • Debugging optimized code.

  • Debugging managed code when the target is a 64-bit application. If you want to use Edit and Continue, you must set the target to x86. (Project Properties, Compile tab, Advanced Compiler setting.).

  • Debugging an old version of your code after a new version failed to build due to build errors.

But I can answer "No" to every item in this list.

It worked before, but several days ago it stopped working, and I don't know what could be the reason.

A: 

Couple of things to check

  • Make sure your compile is set to Debug vs. Release
  • Make sure you're not launching a mixed mode process
  • If on a 64 bit machine Make sure to set the CPU target to x86 rather than AnyCPU

EDIT

I don't believe this should matter but make sure that the hosting process is enabled for the target platform. Probably won't help.

If it repros for new projects then it might be something even more subtle. I would try the following.

  • Backup HKCU:\Software\Wow6432Node\VisualStudio\9.0 (maybe just rename it)
  • Delete the same key
  • Try the repro again
JaredPar
What is a mixed mode process? I even tried new winforms project.
nightcoder
I don't have the HKCU:\Software\Wow6432Node\ node
nightcoder
@nightcoder then try HKCU:\Software\Microsoft\VisualStudio\9.0
JaredPar
doesn't help :(
nightcoder
A: 

That happens when the debugger hasn't hit a breakpoint or you haven't hit Break All (pause). It couldn't be that simple could it?

Richard Hein
It happens when the debugger has hit a breakpoint and I'm trying to change something in the code.
nightcoder
+5  A: 

I finally got to solve the problem: UNINSTALL Gallio

Gallio seems to have quite some many rough edges and it's better to not use MbUnit 3.0 but use the MbUnit 2.0 framework but use the gallio runner, that you are running without installing from the installer (which also installed a visual studio plugin).

Incidentally, I had the issue even after "disabling" he Gallio plugin. Only the uninstall solved the problem.

PS. Edited by nightcoder:
In my case disabling TypeMock Isolator (mocking framework) finally helped! Edit & Continue now works!!!

Here is the answer from TypeMock support:

After looking further into the edit and continue issue, and conversing about it with Microsoft, we reached the conclusion it cannot be resolved for Isolator. Isolator implements a CLR profiler, and according to our research, once a CLR profiler is enabled and attached, edit and continue is automatically disabled. I'm sorry to say this is no longer considered a bug, but rather a limitation of Isolator.

Pejvan
A: 

Disabling TypeMock Isolator plugin helps me as well. Thanks

vasya
-1: Please don't post comments as answers.
Casebash
A: 

I had the same problem. I even re-installed VS 2008 but the problem did not go away. However, when I deleted all the break points then it started to work.

Debug->Delete All Breakpoints

I think it was happening because I had deleted an aspx page that had break points in its code, and then I created another page with the same name. This probably confused the VS 2008.

Amer Bashir

Amer
A: 

Go To Project Solution Property Set Configuration as Debug..

Kaushik
A: 

Debug->Delete All Breakpoints worked for me too. There after it just worked as normal with no need to delete any break points

Peter
A: 

The error says a possible cause is: "the code being debugged was optimized at build or run time". Go to Project Properties->Debug and uncheck the Optimize Code box for Debug mode.

rook
A: 

For me, for a reason that I don't understand, the setting "Generate debug info" in the "Advanced Compiler Settings" was set to "pdb-only" instead of "Full".

By default, this parameter is always set to "Full" but a mysterious poltergeist has changed this parameter on last night. :)

P.S. I'm in Visual Basic .Net with Visual Studio 2010

Samuel