I am trying to generate some code using CodeDom. I wanted to know if there is any way to create CodeMemberMethod from a string.
I found a method, but it generates assembly from string. I wanted to generate some methods from string. Is there any way?
I am trying to generate some code using CodeDom. I wanted to know if
Share
Well, I found the answer. Hope it may help someone else:
We can use
CodeSnippetStatementto include code fragments that will be included directly in source without modification.In addition to that, there is
CodeSnippetCompileUnitthat will compile code units from string literal.