Is it possible to scan for methods with particular attributes within the assembly? I am currently working on Visual C++ project but even C# is fine with me. I need to find all methods within currently assmebly that have a paricular attribute Eg. [XYZ] applied to it. Any thoughts?
Is it possible to scan for methods with particular attributes within the assembly? I
Share
I have used Microsoft Roslyn for a similar task. It should be pretty easy.
Let me know if you need any example code.
And take a look at this post too: http://blog.filipekberg.se/2011/10/20/using-roslyn-to-parse-c-code-files/
Reflection can also be used for that, the GetCustomAttributes method returns all attributes defined on the given member…
Alright, try this:
loop trough all the methods and GetCustomAttributes
That should be it. Unfortunately I don’t have Visual Studio installed on my wife’s laptop 🙂