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?
Asked
Active
Viewed 96 times
1
-
Maybe it will help http://stackoverflow.com/questions/10864311/is-there-a-tool-for-parsing-a-string-to-create-a-c-sharp-func – Alex Aparin Oct 26 '16 at 16:23
-
@АлександрЛысенко: No; he's asking about Roslyn. – SLaks Oct 26 '16 at 16:52
1 Answers
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