> My advice: You don't really need VSA anyway, reflection and dlls are enough.
> Stay away from CreateInstanceAndUnwrap. Learn to love MBV objects, and
> ObjRef. VSA was completely dropped so there's no reason to keep on trying.
> How could I do this using reflection and DLLs while avoiding the GCHandles
> or memory leakage problems? I guess I could compile all of the scripts into
> one assembly and then execute them individually. But really I'll always
> have the same problem of leakage won't I?
As I said, the only way to get no memory leak is to compile it into a file
based assembly on disk, load it in a separate appdomain and don't ever send
the references to the types defined in the script to the main appdomain,
only base types and interfaces. Then by shutting down the appdomain, you
won't have anything leaking.
> What do you mean "VSA was completely dropped"???
Well,
VSA was an attempt at doing VBA with .net languages. Frankly, this project
looks a lot like it's absolutely going nowhere in the foreseeable future, so
you'd be better off not using all the VSA interfaces and doing the
compilation model yourself, while microsoft come up with something more
usable.

Signature
Sebastien Lambla
http://thetechnologist.is-a-geek.com/blog/
None - 27 Nov 2003 06:49 GMT
From everything I've read the problem isn't Vsa per se, it's that assemblies
cannot truly be fully unloaded. That's a problem where you're using Vsa or
Reflection.Emit or whatever.
> As I said, the only way to get no memory leak is to compile it into a file
> based assembly on disk, load it in a separate appdomain and don't ever send
> the references to the types defined in the script to the main appdomain,
> only base types and interfaces. Then by shutting down the appdomain, you
> won't have anything leaking.
Sebastien Lambla - 27 Nov 2003 15:56 GMT
Sure, but using VSA just increase the risk of contaminating your main
assembly with code you compile on the fly, which is a bad thing. As long as
you're cautious, an assembly can be and will be fully unloaded when you
unload its host AppDomain

Signature
Sebastien Lambla
http://thetechnologist.is-a-geek.com/blog/
> From everything I've read the problem isn't Vsa per se, it's that assemblies
> cannot truly be fully unloaded. That's a problem where you're using Vsa or
[quoted text clipped - 6 lines]
> > only base types and interfaces. Then by shutting down the appdomain, you
> > won't have anything leaking.