Hi,
There are several ways of doing this, I will short listed the most well know ones:
1- Use
System.CodeDom.Compiler
this will give you access almost to everything that C# compiler contains. For example, you can call the parser at run-time and ask for a query that you are interested in it.
2- You can use bath files and pre-post build events which allows you to run some batch files before and after each build. Read more in
here
3- You can make your own C# compiler which I do not advice but if you are interested in it then just go ahead and download the source code from the official links such as
C# Compiler Mono
4- Combination of solution 1 and 2 which is also a nice idea.
I hope this will help you to solve your problem if not please do not hesitate to leave a comment then I can improve this solution until your problem got solved or apologize if I was not able to be of help. Good luck.
Cheers,
AH