LINQ is one of my favorite features in C#. It just makes the code look nicer. Instead of tedious foreach loops, we got a neat functional syntax that’s easy to write and understand. Well, at least if we’re using the method syntax flavor of LINQ. LINQ is also terrible to debug. We have no way of knowing what goes on inside that query. We can see the input, we can see the output, but that’s about it.
We all know the value of debugging. Inspecting the values of variables, seeing the call stack, and moving step-by-step are all features that are priceless for developers. But it’s not always simple to get a debugging session going in real-world scenarios. Sometimes, you can’t get the debugger working. Or you’re starting the program from the command line and want to debug from the very start. Perhaps there’s a crash as soon as the app starts.
For almost a year now, I’ve been writing a book about debugging and problem-solving in .NET. I’m pretty upset at whoever said writing a book is just like writing a series of blog posts. That was way more work than I signed up for. But it’s over now and my book Practical Debugging for .NET Developers is available . This book is all about solving bugs. I daresay say that the ability to solve difficult problems is what differentiates great engineers from good engineers.
The Immediate Window looks pretty straightforward, but it hides some cool features. In this post, I’ll show you five tricks you can use with this window that you absolutely should know if you want to debug faster.
When it comes to debugging software, tools are extremely important. Get the right tool and you extract the right information. Get the right information and you can find the root cause of the issue. Find the root cause and you've solved the bug.
You’re sending an HTTP request to your ASP.NET server, and out of the blue, it returns a 500 error. Now what? The error code doesn’t say too much by itself. Did a database request fail? Was there an exception? In this article we'll see how to get the most information on the error.
It's not so rare to see weird things happen in 3rd party library code. Call some method and you've got a strange exception. Or an incorrect behavior or even a process crash. It sure would be nice to debug some of these issues. In this article we're going to do just that - You'll see how to debug 3rd party library code in Visual Studio.
Lock contention is a state where one thread is waiting for another while trying to acquire a lock. Whatever time spent waiting for the lock is "lost" time that is wasted doing nothing and causes performance problems. In this article, you'll see how to detect lock contention problems, debug them, and find the core cause of the issue.
Logging is a big part of software development for many years now. This guide is a bird's eye view of modern solutions for logging in .NET space.