Dynamic code execution

  • Thread starter Thread starter Kurt
  • Start date Start date
K

Kurt

If I remember correctly isn't there a way to execute dynamic code in .Net
like below? Taking a string variable and executing.

"Console.WriteLine("Test");"

Thanks
Kurt
 
Kurt,

Yes, but it is a PITA. Basically, you will have to wrap that string in
a method, then wrap that in a class, then compile it, load it, and run it
all through reflection.

Definitely not worth it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top