question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IronPython 2.7.7 is not compatible with DynamicLanguageRuntime 1.2.0.100.l

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
slidecommented, Feb 6, 2018

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.

0reactions
pankoncommented, Jul 2, 2018

Adding package from .nuget\packages\dynamiclanguageruntime\1.1.2\lib\Net40 worked for me

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found