43

I'm having some problems with Edit and Continue when using Visual Studio 2010 on a Windows 7 64 bit machine. I've ensured the following

  1. Edit and Continue is enabled under Tools>Options>Debugging>Edit and Continue
  2. My solution platform is set to x86
  3. My solution configuration is set to Debug
  4. All my projects are building for Debug and x86
  5. For all projects under Projects>Properties>Build the Optimize code is unchecked

When I hit a break point and try to edit I and confronted with the following message.

Changes are not allowed in the following cases
(source: sedotech.com)

This is happening for me for all projects that I create whether they are WPF/Win Forms/VB.NET/C#/.NET 4/.NET 3.

Any ideas?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Sayed Ibrahim Hashimi
  • 43,864
  • 17
  • 144
  • 178
  • 1
    Just tried on VS 2010 Ultimate with a .NET 4 Console App. I was able to edit and continue. settins: x86, Debug, Optimize Code unchecked, Target framework .net 4 client profile. Could you try creating a console app (in a seperate single project) and see if you run into the same issue? – Raj Kaimal May 08 '10 at 22:22
  • 1
    Do you have a profiler enabled? In my experience that will disable edit and continue. – Brian Rasmussen May 08 '10 at 22:25
  • Thanks guys, it was related to IntelliTrace. See my answer below. – Sayed Ibrahim Hashimi May 08 '10 at 23:11
  • 1
    The answer below is only part of the solution. After much searching online, here is the full recipe that helped me with the EnC problem: For your debug build settings: 1. Target x86. 2. Disable code optimizations. 3. Choose to generate "full" instead of "pdb-only" debug info. 4. Change build path to "\bin" instead of "\bin\x86\debug" 5. Enable Edit and Continue in BOTH Visual Studio settings and in the project's "Web" properties panel (for web applications). – Pete Apr 11 '11 at 16:39
  • Wait for VS2013 if you need Edit and Continue for 64-bit applications! – linquize Jul 26 '13 at 04:35

13 Answers13

30

OK guys I figured it out. The other night I was playing around with IntelliTrace and changed the setting to collect call information. I didn't notice the warning on that page stating "Edit and continue is disabled when collecting Call Information"! See screen shot.

IntelliTrace settings
(source: sedotech.com)

So I just disabled that and I was good to go. Thanks, that was really annoying.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Sayed Ibrahim Hashimi
  • 43,864
  • 17
  • 144
  • 178
  • Ibrahim,Regrets for commenting this answer in 2016 as we still face the same situation but the VS 2013 onwards IntelliTrace has been removed.Any workaround for this?. – Hameed Syed Nov 24 '16 at 11:14
9

Another solution is to check if any 3rd party references included and check their options for: Embed Interop Types. Set it to False.

PantheR
  • 91
  • 1
  • 1
6

One more option to check to enable the Edit and Continue Option.

Go to Project Properties and check the "Enable Edit and continue" Option

enter image description here

NewUnhandledException
  • 733
  • 2
  • 10
  • 34
3

I found the problem!

In Advance Compile Option (in Project Properties) Uncheck Enable Optizimations

Dan McClain
  • 11,780
  • 9
  • 47
  • 67
AliReza Sabouri
  • 4,355
  • 2
  • 25
  • 37
  • I don't see this in VS2010. Is it the same as Project Properties > Build > General > Optimize Code? – Chris Oct 20 '15 at 17:56
2

I had that also solved it by noticing that solution configuration was on release and not debug.

Changed it to debug and now I can edit and continue.

Toon Krijthe
  • 52,876
  • 38
  • 145
  • 202
mona
  • 31
  • 2
1

mine was working after i have done following

under advanced compile options set target CPU to x86 (was set to any cpu)

and its working fine now.

m asif
  • 11
  • 1
1

If you want to edit code after compile.

Just compile with ctrl + F5

OXYJAMES
  • 11
  • 1
1

another reason 1-Right click on Project file then Properties.
2-Compile --> advanced compile options.
3-Choose to generate "full" instead of "pdb-only" debug info.

Mahmoud Salah
  • 144
  • 1
  • 5
0

At the msdn site,

http://msdn.microsoft.com/en-us/library/dd264944(v=vs.100).aspx

You can read about it:

"However, collecting calls and parameters will increase performance overhead, use additional disk space, and disable the Edit and Continue feature of the Visual Studio debugger."

Roger
  • 333
  • 2
  • 13
0

Under Visual Studio 2013 edit and continue now works for the x64 platform.

AnthonyLambert
  • 8,768
  • 4
  • 37
  • 72
  • Great information, but this should really be a comment. It's not an answer to this question – Mick Oct 19 '15 at 02:44
0

Under Code Generation section, make sure option "Enable Function-Level linking" is set to Yes (/Gy).

0

I had that also solved it by noticing that solution configuration was on AnyCPU debug and Project was x86 debug

Changed it to x86 and now I can edit and continue.

Tratak
  • 138
  • 1
  • 9
0

I have a solution for a unique situation.

My Edit and Continue started failing in one function in VS2013. I discovered it was because I was doing some Office Interop to Excel in that function. I moved the Interop code to its own function and Edit and Continue started working in the original function again.

Brad Mathews
  • 1,567
  • 2
  • 23
  • 45