Learn how to build custom C# Roslyn analyzers from start to finish, including project setup, debugging, testing, and real-world usage in Visual Studio and MSBuild.
In this video, I walk through the complete Roslyn analyzer workflow: creating an analyzer project, understanding the project structure, using analyzers in real applications, debugging them, writing unit tests, and dealing with Visual Studio versus MSBuild behavior.
0:00 - Introduction
0:16 - Description
3:17 - Creating an Analyzer
4:30 - Exploring an Analyzer Project
7:43 - How To Use
13:35 - Debugging
17:24 - Real Analyzers
31:22 - Testing
38:51 - Not All Is Perfect
41:34 - Conclusion
This tutorial is useful if you want to enforce coding rules, improve code quality, or build your own analyzer and code fix workflow for .NET projects.
Microsoft’s Roslyn tutorial covers building an analyzer and code fix step by step, and Visual Studio’s analyzer overview also notes that build-time enforcement differs depending on whether analyzers are used through a Visual Studio extension or installed as a NuGet package.
I also cover practical debugging and testing so you can move from a demo analyzer to something you can maintain in a real solution.
#Roslyn #DotNet #VisualStudio
Sample Code
GitHub : https://l.samayas.eu/9bJC5ArAVC?P=SP&...
Follow me on X: https://l.samayas.eu/jo3eaYEf3E?P=YT&...
Buy me a Coffee: https://l.samayas.eu/jX6xL7EWhd?P=YT&...
Studio Equipment
Camera Sony Alpha ZV-E10 II: https://l.samayas.eu/k7y90TREl0?P=YT&...
Secondary Camera Obsbot Tail Air: https://l.samayas.eu/iFQu9WfmCw?P=YT&...
Elgato Prompter: https://l.samayas.eu/fHVrqqXtSc?P=YT&...
Microphone Rode Wireless GO II: https://l.samayas.eu/afBINjiBXN?P=YT&...