1

I have a method in a string which I assume it is well formed and works OK.. with that fact, can I simply use this string to create a node and insert it into a tree using C# Roslyn compiler?

1 Answers1

1

Call ParseCompilationUnit, passing SourceCodeKind.Script in the parse options so that a method declaration is a valid compilation unit.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964