© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
20 replies
HerpeDerpeDerp

Getting started with source analyzers

I'm working on a rather large project and to keep myself from making certain mistakes in the future I need to make sure I never create fields or properties of certain types, with some specific exceptions. Since there is nothing in the language to enforce this I thought I could maybe write a code analyzer for this. However I have never written an analyzer before. Although I can easily find all the technical details online, I have some questions regarding conventions/convenience for the structure of the project(s). I will be using the analyzer exclusively in a single solution (class library and some small console applications spanning many projects, 100k+ lines of code) and will need to use types defined in this solution. Should I create my analyzers inside this solution or outside of it? Do I put all analyzers in a single project or do I keep them separate from each other? Does anyone have any general advice for someone getting started with this, any pitfalls to avoid?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Getting started with source generators
C#CC# / help
3y ago
❔ Analyzers Project
C#CC# / help
3y ago
❔ Getting started with C#
C#CC# / help
3y ago
❔ Need help with code analyzers
C#CC# / help
3y ago