Compiling C# Code at runtime
-
Hi All Can i compile C# code at runtime? If yes how? And how can i use it in my code? Thanks & Regards Sumit Domyan
-
Hi All Can i compile C# code at runtime? If yes how? And how can i use it in my code? Thanks & Regards Sumit Domyan
-
Hi All Can i compile C# code at runtime? If yes how? And how can i use it in my code? Thanks & Regards Sumit Domyan
You need to look under the
Microsoft.CSharp
namespace. You can use theCSharpCodeProvider
class and get a compiler using theCreateCompiler
method. Something like (From MSDN)// Create an instance of the CSharpCodeProvider class.
Microsoft.CSharp.CSharpCodeProvider provider = new CSharpCodeProvider();
// Call the CodeDomProvider.CreateCompiler() method to obtain an ICodeCompiler from the provider.
System.CodeDom.Compiler.ICodeCompiler compiler = provider.CreateCompiler();
compiler.CompileAssemblyFromFiles(...);Regards Senthil _____________________________ My Blog | My Articles | WinMacro
-
Hi All Can i compile C# code at runtime? If yes how? And how can i use it in my code? Thanks & Regards Sumit Domyan
-
Not really, it's IL that's compiled at runtime. Regards Senthil _____________________________ My Blog | My Articles | WinMacro