Is dynamic code execution possible?

  • Thread starter Thread starter Alex Blekhman
  • Start date Start date
A

Alex Blekhman

Hello,

I want to execute piece of code, which was created/loaded dynamically.
JScript/VBScript have this possibility via eval() method. How can I do
something similar in VB.NET? If I can't, then what are the alternatives?

A little background for my problem. I need to implement an application which
enumerates some data. On each data item it calls external plug-ins/hooks. I
need to implement these hooks as simple as possible. Ultimate goal is .js or
..vbs file with function that user will write. However, I don't know how to
execute this function from VB.NET.

Thanks in advance
Alex
 
Hello,

I want to execute piece of code, which was created/loaded dynamically.
JScript/VBScript have this possibility via eval() method. How can I do
something similar in VB.NET? If I can't, then what are the alternatives?

A little background for my problem. I need to implement an application which
enumerates some data. On each data item it calls external plug-ins/hooks. I
need to implement these hooks as simple as possible. Ultimate goal is .js or
.vbs file with function that user will write. However, I don't know how to
execute this function from VB.NET.

Thanks in advance
Alex

Alex,

You may want to look at the System.Reflection and the
System.Reflection.Emit namespaces. These should let you load/create
code dynamically.

I'll look around a bit - it seems I found a good article on this not to
long ago.
 
Tom Shelton said:
You may want to look at the System.Reflection and the
System.Reflection.Emit namespaces. These should let you load/create
code dynamically.

Thanks for pointer. I looked at it. At this time it's really overkill for my
project. MS Script Control suits my needs completely. BTW, the more I look
at .NET the more I'm impressed. These guys created a heck of universe
there..
 
Thanks for pointer. I looked at it. At this time it's really overkill for my
project. MS Script Control suits my needs completely. BTW, the more I look
at .NET the more I'm impressed. These guys created a heck of universe
there..

That's cool... I just wanted to point out that there is an alternative
:)
 
Back
Top