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 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.