How to load portable .NET library within Iron Python script? -


i have serious troubles loading portable .net library (to used in standard .net , silverlight environment) python script.

.net dll file version 4.0.3.319.233 (system.core.dll), ironpython 2.7.1, running in 32bit/x86 mode. visual studio 2010 c# under .net 4. microsoft .net update kb2468871 portable library usage installed (version 2).

if try load library python script:

clr.addreferencetofileandpath(usedpath+"\\mynamespace\\myportablelibrary.dll") 

it can't accessed, , when script reaches type, says: "attribute [type in portable assembly] of 'namespace#' read-only" indicating assembly has not been loaded @ (or silverlight, , can't used python script).

changing code to: (assembly class system.reflection)

portableassembly = assembly.loadfrom(usedpath+"\\mynamespace\\myportablelibrary.dll") # load through .net reflection, python won't load portable assembly properly! clr.addreference(portableassembly) 

results in error: exceptions.ioerror occurred message: [errno 2] not load file or assembly 'system.core, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e, retargetable=yes' or 1 of dependencies. system cannot find file specified.

the last code seems work, when python script called automatically within .net program, instantiating it's own python engine, gives above error when script executed python project in visual studio. python settings in visualstudio, tools\options\python tools\interpreter options x86/32bit mode. environment parameters show .net 4 used.

i've got multiple ways fix c#/.net generated python engine, how can load portable assembly in basic ironpython runtime environment, works in correct .net 4 environment, not trying load .net 2 stuff?

update: restarted , rebuilt portable library after ms kb2468871 update, , uninstalled ironpython , python tools vs, replacing them versions 2.7.3 , 1.5 (vs2010). error 'system.core, version=2.0.5.0' still occurs.

the filenotfoundexception indication loading assemblies using assembly.loadfile instead of assembly.loadfrom, not handling assembly policy correctly. i'm not sure how python code in visual studio works, if able run bootstrapper code before portable assembly has been loaded, try code showed here: pcl retargetable assembly not redirected inside ms crm plugin.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -