I would like to be able to load assembly from byte array inside of
IronPython.
Is there any way to do it directly in IronPython? I'm unable to run
something like clr.AddReference(byte []).


Below is what I do in .NET DLR in order to make this work:

byte[] rawAssemblyFile = File.ReadAllBytes(assemblyName);

Runtime.LoadAssembly(Assembly.Load(rawAssemblyFile));



Another alternative that I use would be the following:

C#

byte[] rawAssemblyFile = File.ReadAllBytes(assemblyName);

Assembly rawAssembly = Assembly.Load(rawAssemblyFile);

Scope.SetVariable("rawAssembly", rawAssembly);

Python

import clr

clr.AddReference(rawAssembly)



I'm just wondering if there's a cleaner way to do this whole thing inside of
IronPython.

Thanks.

Samuel
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to