On Sun, Dec 9, 2012 at 10:11 AM,  <cold_fus...@fastmail.fm> wrote:
> Hello,
>
> I have a WPF app (written in C#) which re-hosts the WF designer along
> with a toolbox control, and I want to add activities written as python
> classes (inherited from NativeActivity) to the toolbox.
> Creating a class and wrapping it in ToolboxItemWrapper works fine, but
> the problem arises when trying to add the wrapped object to a
> ToolboxCategory, I get an exception claiming that the assembly file
> cannot be found:
>
> "Could not load file or assembly 'Snippets.scripting, Version=0.0.0.0,
> Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
> system cannot find the file specified."
>
> I suppose this happens because the Snippets.scripting assembly is
> dynamic and ToolboxCategory.Add tries to load it from file for some
> reason.
>
> Can anyone see a way around this?

First off, sorry for taking so long to get back to you.

The issue here is that IronPython does not (currently) generate
assemblies that can be consumed from other .NET languages directly.
I'm working on fixing that, but it's a difficult problem and I
wouldn't expect it until 2.7.4, sometime in the middle of next year.

In the meantime, one option is to manually build a shim library that
hosts IronPython and calls the Python code. It's a bit tedious to do
for every activity, but if you're writing a tool anyway there may be
ways to automate generating them.

I wish I had a better story for you right now, but it's going to be a
little while longer before it's supported directly.

- Jeff
_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
http://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to