[Ironpython-users] Loading python compiled with clr.CompileModule
stephane.lozier at gmail.com
Tue Apr 3 17:39:39 EDT 2018
The .NET Core version of IronPython does not support assembly generation. I
haven't tried it myself, but you could probably compile the assembly using
the full framework version and then run it with .NET Core 2.0 (assuming
you're not using unsupported APIs).
On Tue, Apr 3, 2018, 5:16 PM Josiah Kiehl, <jkiehl at riotgames.com> wrote:
> Oh, I'm on dotnet 2.0.3, if that's relevant information.
> On Tue, Apr 3, 2018 at 2:15 PM Josiah Kiehl <jkiehl at riotgames.com> wrote:
>> I'm trying to execute this example code:
>> I realize the posted question is a few years old at this point... has
>> something changed in how python, compiled to a DLL via clr.CompileModule,
>> is loaded?
>> I'm getting this error when I run the code in the example at the above
>> Unhandled Exception: System.TypeLoadException: Could not load type
>> 'System.Runtime.CompilerServices.Closure' from assembly 'System.Core,
>> Version=188.8.131.52, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
>> at DLRCachedCode.test$1(CodeContext $globalContext, FunctionCode
>> at IronPython.Compiler.OnDiskScriptCode.Run()
>> (full stack:
>> My ipy.exe, which did the compilation, is 184.108.40.206 and my embedded
>> IronPython is 220.127.116.11, though I get the same error on 18.104.22.168.
>> Am I missing something obvious or is there a better example to use?
>> My end goal is to be able to take a python module defined in a file
>> (foo.py) with some functions defined, compile it into a dll via
>> CompileModule, then load it directly from the dll via ImportModule to skip
>> the performance hit of interpreting the Python at runtime.
> Ironpython-users mailing list
> Ironpython-users at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironpython-users