© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
5 replies
PaperClip

Identifying something with an attribute with IIncrementalSourceGenerator

I am currently using
ForAttributeWithMetadataName
ForAttributeWithMetadataName
. According to the documentation, it has a chance of generating false positives. What I am currently doing is checking the identifier and seeing if it matches the attribute name. This doesn't work in the case where an alias is used, however. Is there a consisstent way to detect an attribute?
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 all methods with an attribute in an optimized way
C#CC# / help
3y ago
Find all methods with an attribute using GeneratorExecutionContext
C#CC# / help
4y ago
Set a class attribute result with a custom attribute
C#CC# / help
3y ago
❔ Return PartialView with ``for`` attribute
C#CC# / help
3y ago