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

Dan Shechter dans at houmus.org
Thu Nov 27 09:45:38 CET 2008


Yeap.

That's the case.

 

You can always try and disassemble OEC's API assembly with ildasm (which I
did 2 years back) just to 

recompile (ilasm) it with a different CLR (Silverlight in your case)

 

In my case I wanted to call their API from Mono on Linux and their assembly
had some dependency on some Win32 Interop to access the registry

IIRC.

 

Alternatively you could get down on your knees and beg them to support
Silverlight :)

 

From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Nummers
Sent: Thursday, November 27, 2008 8:08 AM
To: Discussion of IronPython
Subject: Re: [IronPython] clr assembly reference error in Ipy / Silverlight
(but works in ipy)

 

ok I think that makes sense, thanks

 

Just so I understand, this is really an issue of different .NET frameworks
between the desktop and Silverlight?  So, I would face this issue even if I
did not use DLR and went with C#? 

On Thu, Nov 27, 2008 at 12:50 AM, Curt Hagenlocher <curt at hagenlocher.org>
wrote:

Unfortunately, the Silverlight and desktop CLRs aren't binary-compatible --
you're basically linking against a different set of strongly-named
assemblies when you're building a Silverlight version.  You'll almost
certainly need to contact the vendor and ask them to provide support for
Silverlight in order for it to be usable there.  This may not require much
more work than a simple rebuild, but if they've used any APIs that aren't
supported under Silverlight (like .NET serialization or the original
collection classes) then they'd need to modify the source code as well. 

 

On Wed, Nov 26, 2008 at 9:44 PM, Nummers <danummer at gmail.com> wrote:

Wow , that was fast...

 

Anyway no I did not / can not, this is a third party dll. From the docs
"Technically, it is a .NET 2.0 assembly (DLL library), ..."

On Thu, Nov 27, 2008 at 12:37 AM, Curt Hagenlocher <curt at hagenlocher.org>
wrote:

You've built two different versions of API.dll -- one for the desktop CLR
and one for Silverlight -- yes?

On Wed, Nov 26, 2008 at 9: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 <http://3.2.0.0/> , Culture=neutral,
PublicKeyToken=b6b45f27e2749b17")
and with:
clr.LoadAssemblyByName("API, Version=3.2.0.0 <http://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

 


_______________________________________________
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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20081127/e2e1fd46/attachment.html>


More information about the Ironpython-users mailing list