Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 11 Debugger fixes/features/improvements (for C# debugging in particular)?

Sorry for what seems like it's likely covered in a FAQ/blog somewhere, but my Google-fu is apparently weak. :(

There's a handful of things that the debugging experience in VS 2010 lacks that seems like they're likely to be fixed during VS 11 (at least, IMHO), but it's been hard for me to tell whether they're really on 'the list' or not.

Some that come to mind:

  • edit-and-continue with 64-bit console apps (only works with 32-bit console apps in 2010)
  • edit-and-continue with Silverlight 5
  • watch (and immediate?) expressions with lambdas / anon delegates
  • edit-and-continue being ok with edits to methods that contain lambdas
like image 289
James Manning Avatar asked Jan 05 '12 15:01

James Manning


People also ask

What does debugging do in Visual Studio?

In the Visual Studio context, when you debug your app, it usually means that you are running the application with the debugger attached (that is, in debugger mode). When you do this, the debugger provides many ways to see what your code is doing while it runs.

How do I debug C sharp code in Visual Studio?

To start debugging, select F5, or choose the Debug Target button in the Standard toolbar, or choose the Start Debugging button in the Debug toolbar, or choose Debug > Start Debugging from the menu bar. The app starts and the debugger runs to the line of code where you set the breakpoint.

How do I stop auto debugging in Visual Studio?

To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.


2 Answers

As of the Developer Preview version, VS11...

  • edit-and-continue with 64-bit console apps STILL ARE NOT SUPPORTED
  • watch (and immediate?) expressions with lambdas / anon delegates STILL ARE NOT SUPPORTED
  • edit-and-continue being ok with edits to methods that contain lambdas STILL ARE NOT SUPPORTED
  • edit-and-continue with Silverlight 5 (I DON'T KNOW)

Don't let any of this stuff put you off, however. There are plenty of new features in VS11, and there's still a year before it's released anyway. Who knows? They might decide to add support for one of these.

Also, by the way, it is very unlikely that they will support Edit and Continue with lambdas / LINQ / anon delegates in the future. Why? Well, it has to do with the way that these language constructs are converted to IL. They may seem simple in a CS language file, but even the most basic lambda expression (something like i => i + 1) is actually converted into a hidden class at compile-time. This goes beyond the scope of Edit and Continue. If you're interested, create a very simple program that uses lambdas or delegates, compile it, and open it up in .NET Reflector. (http://www.reflector.net/. You can get a 30 day trial if you don't want to buy it.) Select the language as "IL" and try to make sense of it!

like image 103
leviathanbadger Avatar answered Oct 05 '22 23:10

leviathanbadger


The prior issue was closed (deferred) so please vote for a new issue asking/begging for 64bit EditAndContinue (EnC) in 11.

https://connect.microsoft.com/VisualStudio/feedback/details/736684/edit-and-continue-is-not-supported-when-debugging-a-64-bit-application

like image 33
DeannaD Avatar answered Oct 06 '22 00:10

DeannaD