generating dll at runtime

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi guys,
I am trying to generate a dll file from a class file at runtime for
reflection purposes.
I am using System.Diagnostics.Process class to run a batch file that will do
this:

csc /t:library %1

Unfortunately the run-time window that opens when I run from Visual
Studio.NEt does not recognize 'csc'. Is there a way I can put it on the
windows path or something?
I am going to use the process class that runs another bat file that executes
my project executable, so I dont have a Visual Studio Command line to work
with.

Thanks. Any help will be appreciated.
 
Faraz,

Why not use the Compiler class in the Microsoft.CSharp namespace? You
can set a reference to cscompmgd.dll, and then access it programatically.

It should be noted that this will be marked as Obsolete in .NET 2.0.
I'm not sure what replaces it (although I am sure there will be something).

Hope this helps.
 
Back
Top