How to programmatically parse and modify C# code

后端 未结 6 1680
情话喂你
情话喂你 2020-12-31 10:46

What I want to do is to read C# code, parse it, insert some method calls and compile it finally.

Is it possible to convert C# source code (a list of strings) to Code

6条回答
  •  再見小時候
    2020-12-31 11:50

    It is not directly possible to do this with the core .NET Framework. You need to use third party or add-on tools, for example:

    • Open source C# Parser: http://www.codeplex.com/csparser
    • GPLEX paired with a C# grammar: http://plas.fit.qut.edu.au/gplex/

提交回复
热议问题