C# Debugging in Visual Studio 2019 Tutorial - Part 1

C# Debugging in Visual Studio 2019 Tutorial - Part 1

This tutorial is part of a series: Part 1 – Getting started with Visual Studio Debugging Part 2 – Visual Studio Debugging Tool Windows Unfortunately, writing code goes hand in hand with creating bugs. We all cause bugs, it’s one of the inevitable facts of life. This process of solving those bugs is called Debugging. Debugging comes in many forms: Stepping through the code with a debugger, investigating logs, unit testing, profiling, and analyzing dumps.

Prevent (some) MEF loading crashes with a Roslyn Analyzer

Prevent (some) MEF loading crashes with a Roslyn Analyzer

If you’re working on a MEF (Managed Extensibility Framework) application, you’re probably familiar with its ups and down. On the one hand, MEF is a powerful plugin system, that’s a pleasure to work with once you know it well. On the other hand, we all encountered strange failures that originated with MEF. Such failures are a nightmare to debug and identify. There are several reasons why a MEF failure might happen.

Creating a Roslyn Analyzer that wraps code in a try/catch statement

Creating a Roslyn Analyzer that wraps code in a try/catch statement

I recently had to create a Roslyn Analyzer that envelopes code in a try/catch statement. This reasoning was to prevent loading errors in any exported MEF component . Here’s the analyzer in action: The analyzer does the following: Adds a Diagnostic that finds a MEF ImportingConstructor with content that’s not entirely wrapped in a try/catch statement. Provides a Code Fix to handle the problem. The Code Fix will: Add a try/catch statement around the entire content Add ErrorNotificationLogger.

Visual Studio 2017 Extension tutorial 8: Add UI in the indicator margin with Glyphs

Visual Studio 2017 Extension tutorial 8: Add UI in the indicator margin with Glyphs

Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 4: Show a popup Window Part 5: Highlight code in Editor Part 6: Follow a span of code with TrackingSpan Part 7: Insert buttons between text characters with Adornments During the tutorial we are going to build a VS extensions called CodyDocs and place it on GitHub .

Visual Studio 2017 Extension tutorial 7: Insert buttons between text characters with Adornments

Visual Studio 2017 Extension tutorial 7: Insert buttons between text characters with Adornments

Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 4: Show a popup Window Part 5: Highlight code in Editor Part 6: Follow a span of code with TrackingSpan Part 8: Add UI in the indicator margin with Glyphs During the tutorial we are going to build a VS extensions called CodyDocs and place it on GitHub .

Visual Studio 2017 Extension development tutorial part 6: Follow a span of code with TrackingSpan

Visual Studio 2017 Extension development tutorial part 6: Follow a span of code with TrackingSpan

Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 4: Show a popup Window Part 5: Highlight code in Editor Part 7: Insert buttons between text characters with Adornments Part 8: Add UI in the indicator margin with Glyphs During the tutorial we are going to build a VS extensions called CodyDocs and place it on GitHub .

7 Debugging Techniques you should know in C# .NET

7 Debugging Techniques you should know in C# .NET

I think I spend more time debugging code than writing code, designing software architecture, trying to reproduce bugs and even going to meetings! Debugging is the biggest time consumer we have as developers. As time goes by, I keep learning new tricks that make my debugging more effective. I’ve gathered in this post 7 debugging techniques that I learned relatively late into my career and I consider advanced (though sometimes something advanced for some is trivial for others).

Visual Studio 2017 Extension development tutorial part 5: Highlight code in Editor

Visual Studio 2017 Extension development tutorial part 5: Highlight code in Editor

Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 4: Show a popup Window part 6: Follow a span of code with TrackingSpan Part 7: Insert buttons between text characters with Adornments Part 8: Add UI in the indicator margin with Glyphs During the tutorial we are going to build a VS extensions called CodyDocs and place it on GitHub .

Visual Studio 2017 Extension development tutorial, Part 4: Show a popup Window

Visual Studio 2017 Extension development tutorial, Part 4: Show a popup Window

Tutorial Table of Contents: Part 1: Introduction to VS extensibility Part 2: Add Menu Item Part 3: Add command to context menu and get selected code Part 5: Highlight code in Editor part 6: Follow a span of code with TrackingSpan Part 7: Insert buttons between text characters with Adornments Part 8: Add UI in the indicator margin with Glyphs During the tutorial we are going to build a VS extensions called CodyDocs and place it on GitHub .