Runtime Compilation / Scripting

  • Thread starter Thread starter Peter Sedman
  • Start date Start date
P

Peter Sedman

I need to be able to customise the business logic in my application by
writing code that is compiled and executed at runtime. I want to be able to
write this code using my own simple interface which compiles code entered
into a multi-line text box and also have the option of writing/editing the
code using VS.Net.

The way I see it working is that my middle tier business object loads an
assembly containing the customised code and executes the required method
passing it any required parameters.

Is VSA the way to go? I know Microsoft have pulled the VSA IDE, but I'm
happy to write my own simple IDE and use VS.Net for more complex scenarios.

Can anybody point me in the right direction and outline the principles
involved in introducing customised code to business object.

Thanks,
Peter
 
Hi Peter,
I need to be able to customise the business logic in my application by
writing code that is compiled and executed at runtime. I want to be able to
write this code using my own simple interface which compiles code entered
into a multi-line text box and also have the option of writing/editing the
code using VS.Net.

The way I see it working is that my middle tier business object loads an
assembly containing the customised code and executes the required method
passing it any required parameters.

Is VSA the way to go? I know Microsoft have pulled the VSA IDE, but I'm
happy to write my own simple IDE and use VS.Net for more complex scenarios.

Can anybody point me in the right direction and outline the principles
involved in introducing customised code to business object.

If you're willing to write your own IDE take a look at
Microsoft.CSharp.CSharpCodeProvider.CreateCompiler(). You are able to pass
source into the compiler class and have it generate an assembly, which you
can send afterwards to your middle-tier.

CU Christoph
 
Back
Top