[IronPython] WPF module in IronPython scripting?

Lukáš Duběda loocas at duber.cz
Fri Apr 15 19:41:10 CEST 2011


Unfortunately loading the Assembly didn't work, it threw an error:

dotNet runtime exception: Could not add reference to assembly 
IronPython.Wpf.dll

Nothing else. :(

Unfortunately we don't have access to the Host app's source at all,
we're only writing a .NET plugin that enables us to run IronPython
inside the host app's native scripting language.

But I'll talk to the programmer who wrote the actual IPy plugin
for me and see what the problem might be.

I just thought it's something related to .NET and IPy only.

Thank you!

Lukáš Duběda
Director
[T] +420 602 444 164

duber studio(tm)
[M] info at duber.cz
[W] http://www.duber.cz

[A] R.A.Dvorského 601, Praha 10
[A] 10900, Czech Republic, Europe

On 15.4.2011 18:38, Dino Viehland wrote:
> Lukáš wrote:
>> Hi there everyone,
>>
>> I just bumped into a problem where when I run the IPy.exe console and
>> execute a script that contains:
>>
>> import wpf
>>
>> all works well. However, when I want to import the wpf namespace into the
>> same script, but run outside the IPy.exe (i.e. as an embedded engine) I get
>> an error saying that the module wpf doesn't exist!
>>
>> I even tried to add the IronPython.Wpf.dll into the PATH, I tried referencing
>> it in my script via clr.AddReferenceToFile, nothing works and I don't have
>> access to the wpf methods etc...
>>
>> Is there anything I can do about it?
>
> I would have expected AddReferenceToFile to work but what about doing a
> scriptRuntime.LoadAssembly(typeof(Wpf).Assembly);  where the host app
> has a reference to IronPython.Wpf.dll?
>
> I think the code for loading from the DLLs directory is ipy.exe specific - you could
> also look at replicating that for your host app so there's a general way to add
> additional Python built-in modules.
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list