Jump to content
Nytro

Compiling C# Code at Runtime

Recommended Posts

[h=1]Compiling C# Code at Runtime[/h]By Lumír L? Kojecký, 25 Jan 2014

[h=2]Introduction[/h] Sometimes, it is very useful to compile code at runtime. Personally, I use this feature mostly in these two cases:

  • Simple web tutorials – writing a small piece of code into TextBox control and its execution instead of the necessity to own or to run some IDE.
  • User-defined functions – I have written an application for symbolic regression with simple configuration file where user can choose some of my predefined functions (sin, cos, etc.). The user can also simply write his own mathematical expression with basic knowledge of C# language.

If you want to use this feature, you don’t have to install any third-party libraries. All functionality is provided by the .NET Framework in Microsoft.CSharp and System.CodeCom.Compiler namespaces.

Articol:

http://www.codeproject.com/Tips/715891/Compiling-Csharp-Code-at-Runtime

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...