IronPython 2.7.7 is not compatible with DynamicLanguageRuntime 1.2.0.100.l
See original GitHub issueThe following C# Console application project code, using IronPython 2.7.7, throws an exception when the project is referencing DynamicLanguageRuntime 1.2.0.100.l. It works just fine when the project is referencing DynamicLanguageRuntime 1.1.2.
using IronPython.Hosting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestApp
{
class Program
{
static void Main(string[] args)
{
var options = new Dictionary<string, object>();
options["Frames"] = true;
options["FullFrames"] = true;
var engine = Python.CreateEngine(options);
string pyscript = @"";
var script = engine.CreateScriptSourceFromString(pyscript);
var paths = engine.GetSearchPaths();
}
}
}
When using DynamicLanguageRuntime 1.2.0.100.l, the exception that’s thrown is:
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in Microsoft.Scripting.dll
Whose inner exception reads:
Could not load type 'System.TypeExtensions' from assembly 'Microsoft.Scripting, Version=1.2.0.0, Culture=neutral
Inner Exception Source:
IronPython
Inner Exception Stack Trace:
at IronPython.Runtime.PythonContext.GetInitialPrefix()
at IronPython.Runtime.PythonContext..ctor(ScriptDomainManager manager, IDictionary`2 options)
The Nuget page claims IronPython 2.7.7 should be compatible with any version of DynamicLanguageRuntime >= 1.1.2, so there’s either a bug, or the dependency constraint should be updated. Again, the exception is not thrown when the project is using DynamicLanguageRuntime 1.1.2.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
IronPython 2.7.7: Could not load type 'System.TypeExtensions ...
IronPython 2.7.7 is supposed to be compatible with DynamicLanguageRuntime (>= 1.1.2), but this doesn't appear to be the case.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The dependency in 2.7.7 is incorrect. There is not a way to update the nuget package for 2.7.7, nuget doesn’t allow this. This is a known issue. The recommendation would be to add a reference to DynamicLanguageRuntime 1.1.2 and then add a reference to IronPython 2.7.7.
Adding package from .nuget\packages\dynamiclanguageruntime\1.1.2\lib\Net40 worked for me