[IronPython] clr assembly reference error in Ipy / Silverlight (but works in ipy)

Jimmy Schementi Jimmy.Schementi at microsoft.com
Mon Dec 1 23:26:25 CET 2008


Correction: the AppManifest.xaml is only for assemblies you want to load when the application starts. Doing clr.AddReference will currently look in the XAP and load the assembly at any time in the program's execution, without needing to have it listed in the AppManifest.xaml.

> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] On Behalf Of Neil(???)
> Sent: Thursday, November 27, 2008 11:08 PM
> To: Discussion of IronPython
> Subject: Re: [IronPython] clr assembly reference error in Ipy /
> Silverlight (but works in ipy)
>
> Well, I guess there is another issue which will possibly cause your
> error message.
>
> With chiron, if you need to reference an additional assembly, you also
> need to modify the AppManifest.xaml file by hand and add an entry to
> it, like this:
>
>   <Deployment.Parts>
>     <!-- Add additional assemblies here -->
>     <AssemblyPart Source="Microsoft.Scripting.Silverlight.dll" />
>     <AssemblyPart Source="Microsoft.Scripting.ExtensionAttribute.dll"
> />
>     <AssemblyPart Source="Microsoft.Scripting.Core.dll" />
>     <AssemblyPart Source="Microsoft.Scripting.dll" />
>     <AssemblyPart Source="IronPython.dll" />
>     <AssemblyPart Source="IronPython.Modules.dll" />
>     <AssemblyPart Source="System.Windows.Controls.Data.dll" />
>   </Deployment.Parts>
>
> Best Regards,
> Neil Chen
>
> On Thu, Nov 27, 2008 at 1:35 PM, Nummers <danummer at gmail.com> wrote:
> > Just getting going on Ipy / Silverlight and hit a roadblock.
> >
> > This works on ipy but gives an error w/ Ipy in Silverlight (IOError:
> Could
> > not add reference to assembly API.dll).
> >
> > import clr
> > clr.AddReference('API.dll')
> > from OEC.API import *
> > from OEC.DATA import *
> >
> > same kind of error with:
> > clr.AddReference("API, Version=3.2.0.0, Culture=neutral,
> > PublicKeyToken=b6b45f27e2749b17")
> > and with:
> > clr.LoadAssemblyByName("API, Version=3.2.0.0, Culture=neutral,
> > PublicKeyToken=b6b45f27e2749b17")
> >
> > Now, this gives no error:
> > clr.AddReferenceToFile("API.dll")
> > However the imports fail (ImportError: No module named OEC.API
> >
> > Not too much experience loading assemblies but, as I said, all is
> well in
> > ipy.
> >
> > Hope I'm just doing something stooopid.
> >
> > Very much appreciate any help!
> >
> > Dano
> > _______________________________________________
> > Users mailing list
> > Users at lists.ironpython.com
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
> >
> _______________________________________________
> 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