I have a requirement to get the contents of every method in a cs file into a string. What I am looking for is when you have an input of a cs file, a dictionary is returned w
I don't know if it's any use to you but Visual Studio Addins include a EnvDTE object, that gives you full access to the VB and C# language parsers. See Discovering Code with the code Model
I touched on it tangentially years ago, I don't know how difficult it is to use, or how effective it is, but it does look like it will give you what you need.
The code model allows automation clients to avoid implementing a parser for Visual Studio languages in order to discover the high-level definitions in a project, such as classes, interfaces, structures, methods, properties, and so on.
If you read the article in full it tells how to pull the full text from a file for a function
Hope this helps :)