[IronPython] IPy 2.x and ASP.NET 3.5
mdraghi at gmail.com
Thu Aug 27 15:21:25 CEST 2009
After many hours running different experiments, I still can't find a
way to embed IronPython 2.x in a ASP.NET 3.5 web site.
I have read this:
and tried the solution on this CodePlex workitem:
... but nothing works.
If I use the "shipped" Microsoft.Scripting.ExtensionAttribute.dll, I
get the "ambiguous..." compilation error that originated the workitem
If I use the "modified" Microsoft.Scripting.ExtensionAttribute.dll
attached to the workitem, it refuses to be loaded. When I try to
instantiate the engine, I get an error telling me that the
Microsoft.Scripting.ExtensionAtribute cannot be loaded. It seems that
IronPython 2.0.2 expects versions 0.9.0.0, and the patched DLL is
I tried to solve the last issue using a "dependentAssembly" node in
the web.config, like this:
publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.9.0.0" newVersion="18.104.22.168"/>
... but it doesn't work either. The DLL cannot be loaded.
I tried to compile my own Microsoft.Scripting.ExtensionAttribute.dll
using the "type forwarding" trick mentioned in Michaeld's post, but
then I run into signing issues, and my DLL can't be loaded.
I even tried a suggestion discused here some time ago, about
recompiling IronPython taking away the
Microsoft.Scripting.ExtensionAttribute project, and using 3.5 as a
target (adding references to System.Core), but it seems it is not as
simple as that: As soon as I start changing targets, I start getting
more and more "collitions" with System.Core and IronPython's own
So, in a nuthshell, I downgraded to IPy 1.1 (and I *hate* having to do
that!), which is old, but works like a charm.
But I *really, really* would like to find a proper solution to this,
or at least a workarround that... *works*, without having to mess
around with IronPython's source code.
I'm very sad because this problem is also reproducible with the last
beta of IPy 2.6, so it seems we're going to get another major release
that cannot play well with ASP.NET 3.
Is there anything I can do yo embed IronPython 2 in a ASP.NET 3.5 application?
Thank you very much,
More information about the Ironpython-users