Visual Studio 2015 Debugging Features Highlights
Visual Studio 2015 has been released and it comes packed with fun new features (https://www.visualstudio.com/features/ ) that are bound to make your development experience better than ever. The first features that immediately grabbed my attention are the new Debugging Tools in Visual Studio 2015. They remove a good amount of friction and some of them are just plain spectacular! So without further ado, here are some of the highlights I have encountered so far in working with these tools:
Application Insights Integration
How many times have you deployed an application to the Cloud only to have a glitch show up and not know exactly what the issue may be? Right away you would probably go to your logs and start searching for the issue and see if you can reproduce it and hopefully patch it right away.
With Application Insights integrated into Visual Studio 2015 you can have a real time ‘logger’ right at your fingertips, and in real! What’s more exciting is that once you run your application, from the start you will get a nice and unobtrusive message letting you know that your Application Insights events are starting to come in. A simple click on the purple light bulb link: Open Application Insights, takes you right to the Azure Portal at the page containing the events for the application you are currently deploying. It’s a nicer way to see what is really going on in your application:
The new built in Diagnostic Tools in Visual Studio 2015 start by default when you debug a newly created project. The tools shows Memory and CPU utilization in a nicely integrated fashion as you run your application:
You can also compare different snapshots from the same window and search for specific object types using the Search functionality:
What is more, you can click on an Object Type and see the Instances of RuntimeType, yes, it is that powerful!
Another new feature that I like and comes in very handy to me is the ability to quickly determine which types of exceptions I want to listen for while debugging. Visual Studio has pretty much always allowed you to choose which exceptions to listen for, but now in Visual Studio 2015 the Exception Settings windows appears during debugging and allows you to select/deselect with types of exceptions you really care to be informed of at the click of a check box:
The Conditional Breakpoints debugging feature gets a face lift in Visual Studio 2015. If you have used this feature before, then you know that it can make it easier to break your debugging code only when you need to. And now the UI for this feature becomes much simpler and straight forward. Essentially Friction Free!
Simply set a break point and select Settings…
You will see an expanded window to set Conditions and Actions
You can even select predefined types of things to show in the Output Window, such as the call stack:
And this is my favorite new feature of the Visual Studio Debugging Tools, being able to debug lambda expressions! If you recall, this is not possible to do in Visual Studio 2013 and below:
When we try to debug the lambda expression we get this message: “Expression cannot contain lambda expressions“…how frustrating…isn’t it? But now, here is the same code being debugged in Visual Studio 2015:
In the example above I first want to see just the first user, so I just type: “activeDirectoryClient.Users.Take(1);” in the Immediate Window and I can see the results. Then, if I just want to see what is in ‘Users’ object, I just call it as such: “activeDirectoryClient.Users” and see the results. We can do even more with this feature, such as predicate filters, but this should give you a sense of what is possible now in Visual Studio 2015. I will strive to cover more of this feature in upcoming posts.
I plan to expand more on the new Visual Studio 2015 features in a future post also. This has been just a small set of new features that I have found useful when debugging in the new IDE, hopefully this is useful to you.