How to build CodeCompileUnit from source code?
What is the best way to parse a C# source code(s)?
Is CodeCompileUnit a correct selection? and howto?
Thanks
You've got that backwards, CodeCompileUnit is there to generate source code. If you already have the source code then you only need a class that inherits CodeDomProvider to compile the code. Like Microsoft.CSharp.CSharpCodeProvider or Microsoft.VisualBasic.VBCodeProvider.
There are some odds that you are asking about parsing an existing source code file. That's what the System.CodeDom.Compiler.CodeParser was intended to do. There are no existing concrete implementations of that abstract class, there will never be any. This blog post explains why.