Better together: C# 6 and the Visual Studio 2015 Debugger

“Lambdas! Lambdas! Lambdas! Lambdas! …” If you hadn’t heard, Visual Studio 2015 will support the use of lambda expressions in the debugger windows. We’re all very excited to deliver on this longstanding TOP customer request. When LINQ was introduced in 2008 it was a game changer for the way .NET developers think about and code… Read more

Introducing the Visual Studio 2015 Preview for C# and VB

Download Visual Studio 2015 Preview and review the release notes. Over the past several years, our team has been hard at work re-implementing the full language stacks for C# and Visual Basic. While this was a long investment, we knew that an improved stack with a cleaner architecture would allow our team to work faster,… Read more

Debugging Expression Trees in Visual Studio 2010

First of all, let’s take a look at the example from one of my previous posts. It creates an expression tree for calculating the factorial of a number.ParameterExpression value = Expression.Parameter(typeof(int), “value”); ParameterExpression result = Expression.Parameter(typeof(int), “result”); LabelTarget label = Expression.Label(typeof(int)); BlockExpression block = Expression.Block( new[] { result }, Expression.Assign(result, Expression.Constant(1)), Expression.Loop( Expression.IfThenElse( Expression.GreaterThan(value, Expression.Constant(1)),… Read more

How do I send out simple debug messages to help with my debugging?

Visual Studio offers tons of useful debugging features and allows you to step through your code line-by-line. However, there are times when you don’t want to step through your application, but want to make it output simple text strings with variable values, etc. Enter the System.Diagnostics.Debug class and its Write* methods. By using the Debug… Read more

How can I easily log a message to a file for debugging purposes?

Often, you need a way to monitor your applications once they are running on the server or even at the customer site — away from your Visual Studio debugger. In those situations, it is often helpful to have a simple routine that you can use to log messages to a text file for later analysis…. Read more