All posts with Tag Diagnostics

How to create a DiagnosticSuppressor

In the previous post, I showed several ways a developer can statically suppress a DiagnosticAnalyzer. However, what if you need to suppress diagnostics only when a specific code condition is met? In Roslyn, this is exactly what a DiagnosticSuppressor enables. In this post, we will explore how conditional suppression works and why it can be a powerful tool in building smarter C# analyzers.

Read the whole article

Write your own Code Analyzer with Roslyn

We are all familiar with diagnostics that are provided from the compiler when we develop an application, they could be in form of warnings, errors or code suggestions. A diagnostic or code analyzer, inspects our open files for various metrics, like style, maintainability, design, etc. However, sometimes we need to write a tailor-made analysis for our specific situation, tool, or project.

Read the whole article

An error has occurred. This application may no longer respond until reloaded. Reload x