15

I'm trying to get edit-and-continue working with Visual Studio 2008 with an ASP.Net MVC project. I'm running 64-bit, so that adds to the problem.

In Configuration Manager, my active solution platform is x86 and all the projects are targeting Debug x86 as well.

In the project properties I have "Enable Edit and Continue" selected.

In Tools->Options...->Debugging->Edit and continue I have "Enable Edit and Continue" selected.

In Tools->Options...->Debugging->General I have "Break all processes when one project breaks" enabled.

As soon as I try to change some source code outside of a view/template'I get the message: Edit and continue: Changes are not allowed while code is running or if the option 'Break all processes when one project breaks' is dissabled. The option can be enabled in Tools, Options, Debugging.

Any ideas how to get it to work?

Webjedi
  • 4,677
  • 7
  • 42
  • 59
Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622
  • Does this happen with all your projects, or just one of them? Does it happen when you try and run your project on another machine? – Richie Cotton Jul 10 '09 at 12:47
  • Richie, it happens with all my projects. I don't have another machine to try on. – Pablo Fernandez Jul 14 '09 at 05:34
  • The whole Edit & Continue process in VS is badly done, VS should not let you have conflicting settings. Also the fact that settings are scattered depending on language and project type, requiring 32bit builds just makes it worse. –  Jul 15 '09 at 23:34
  • Similar question: http://stackoverflow.com/q/5672961/758666 – wip Oct 29 '13 at 02:18

5 Answers5

13

Do you have Enable Optimizations checked? (Advanced Compile Options), I don't think you can have that checked...

Also: http://blogs.msdn.com/webdevelopertips/archive/2008/11/26/tip-29-did-you-know-how-to-enable-edit-and-continue-feature-for-web-application-projects.aspx

  • Where's this Advanced Compile Options? What do you mean by disabling unmanaged code an SQL? – Pablo Fernandez Jul 12 '09 at 13:49
  • 2
    in C# projects: Project Settings Build / Optimize code [uncheck] Debug / Enable Debuggers / Enable SQL Server Debugging, Enable unmanaged code debugging [uncheck both] –  Jul 13 '09 at 14:01
  • eschneider, do you mean project properties? – Pablo Fernandez Jul 14 '09 at 05:44
  • yes, the project settings. They are a bit different for C# vs VB.NET –  Jul 14 '09 at 06:58
  • Optimizing code was never checked. There's no Debug section in there. – Pablo Fernandez Jul 15 '09 at 05:39
  • In a web project settings look at Start Options : Debuggers (at the bottom) Look for "Native code" & "Sql Server", I think these need to be unchecked. –  Jul 15 '09 at 06:20
  • +1 This has solved the problem for me on a VB.NET project! Awesome! – dance2die Jul 15 '09 at 21:04
  • "Optimized" checkbox location on VB.NET project (VS 2008): Project Properties -> Compile tab -> Advanced Compiler Options button -> Enable Optimization checkbox – dance2die Jul 15 '09 at 21:05
  • In project properties, in the Web tab, I always had native code and sql server disabled. – Pablo Fernandez Jul 16 '09 at 05:24
  • I'm running out of ideas.. Are you using a Debug build? VS Menu / Build / Configuration manager Are all the projects using project reference an not file references? Are all the projects configured for edit and continue? Tried deleting all the current build outputs and performed a clean build? Tried to edit and continue on a different machine? –  Jul 16 '09 at 06:15
  • Another thing people can check is the “Target CPU”, it can not be x64, apparently it’s too difficult for MS to get it working in x64. –  Oct 27 '10 at 15:46
7

For VS2010 try this

alt text

Eric Labashosky
  • 29,484
  • 14
  • 39
  • 32
3

You can't 'edit and continue' when the program is running. You must break to edit and continue, and if you have many threads you must break all. If when breaking, some threads continue to run, it not a problem with 'edit and continue' but a problem with the break options.

Note: You don't need to stop the program, but you must break, and then you can continue.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Clangon
  • 1,408
  • 2
  • 18
  • 24
  • If I have to stop the program, then what's the use? it's already stopped! If I understand correctly, using ASP.Net you can just modify code and it gets recompiled on-demand, am I wrong? – Pablo Fernandez Jul 15 '09 at 05:40
  • 3
    You don't need to stop the program, but you must break, and then you can continue. It makes sense, you can't change a program while it's running, it's like fixing the road while cars are driving on it. You can pase the program or add a breakpoint before the area you want to edit, and then when the breakpoint is reached you can edit and continue. it's called 'edit and continue' which meens you are paused now, not 'edit while running'... Good luck – Clangon Jul 15 '09 at 07:20
  • You can change an ASP.Net program while is running, am I wrong? You can also change a PHP program, but that's not fair. You can do hot loading of code in Java and in Erlang it's fantastic. But at any rate, even if I'm paused, I'm not allowed to change any code. – Pablo Fernandez Jul 16 '09 at 05:25
  • Is break all processes when one process breaks on? if so you should be able to edit when you break, or at least get a different error message. – Clangon Jul 16 '09 at 09:24
1

Are you using IIS or the built in Visual Studio development server for debugging? I've had trouble before getting edit and continue running under IIS, and ended up just using the built in server.

tbreffni
  • 5,082
  • 5
  • 31
  • 30
1

I open a separate browser window (so it doesn't close when I stop debugging) then I stop debugging, make changes and build them and just carry on using the other browser window to view the changes. (Yes - this works even with changes in your class files, controllers etc).

If you just want to change the views, CSS or scripts you just need to shift and refresh to make sure your browser gets the updated files rather than using the cache.

If this sounds odd to anyone - try it! It works!

Fenton
  • 241,084
  • 71
  • 387
  • 401