tags:

views:

46

answers:

1

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?

+1  A: 

Well, I found the answer. Hope it may help someone else:

We can use CodeSnippetStatement to include code fragments that will be included directly in source without modification.

In addition to that, there is CodeSnippetCompileUnit that will compile code units from string literal.

cornerback84