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
  • 837,282
  • 173
  • 1,862
  • 1,933