AndersMalmgren / FreePIE

Programmable Input Emulator
644 stars 144 forks source link

Crash caused by method not found, when launching a simple script #67

Open cpupower opened 9 years ago

cpupower commented 9 years ago

Description

When launching a very simple script, like an empty one, or the following one, FreePIE does not find a method, handles the exception (TargetInvocationException) in the handler of ExecuteSafe and crashes afterwards with a MissingMethodException.

Platform

Operating System: Windows 7 64 bit FreePIE version: Latest installer (v1.9.611.0) and also latest master branch commit (72ec5b854b1f69883db7e097e62eb5dda729436e), compiled with VS 2013

Files

Script for testing:

def update():
    pass

if starting:
    pass

FreePIE.log:

12.09.2015 11:54:37 - System.Reflection.TargetInvocationException - Failed to load language 'IronPython 2.7.5': Methode nicht gefunden: "System.Collections.Generic.IEnumerable1<!!0> Microsoft.Scripting.Utils.ReflectionUtils.GetCustomAttributes(System.Reflection.Assembly, Boolean)".: bei Microsoft.Scripting.Runtime.LanguageConfiguration.LoadLanguageContext(ScriptDomainManager domainManager, Boolean& alreadyLoaded) bei Microsoft.Scripting.Runtime.DlrConfiguration.LoadLanguageContext(ScriptDomainManager manager, LanguageConfiguration config) bei Microsoft.Scripting.Runtime.DlrConfiguration.TryLoadLanguage(ScriptDomainManager manager, AssemblyQualifiedTypeName providerName, LanguageContext& language) bei Microsoft.Scripting.Runtime.ScriptDomainManager.GetLanguageByTypeName(String providerAssemblyQualifiedTypeName) bei Microsoft.Scripting.Hosting.ScriptRuntime.GetEngineByTypeName(String assemblyQualifiedTypeName) bei IronPython.Hosting.Python.GetEngine(ScriptRuntime runtime) bei FreePIE.Core.ScriptEngine.Python.PythonScriptEngine.get_Engine() bei FreePIE.Core.ScriptEngine.Python.PythonScriptEngine.<>c__DisplayClass5.<>c__DisplayClass7.<Start>b__2() bei FreePIE.Core.ScriptEngine.Python.PythonScriptEngine.ExecuteSafe(Action action, Boolean logToFile) System.MissingMethodException - Methode nicht gefunden: "System.Collections.Generic.IEnumerable1<!!0> Microsoft.Scripting.Utils.ReflectionUtils.GetCustomAttributes(System.Reflection.Assembly, Boolean)".: bei IronPython.Runtime.Binding.PythonBinder.DomainManager_AssemblyLoaded(Object sender, AssemblyLoadedEventArgs e) bei IronPython.Runtime.Binding.PythonBinder..ctor(PythonContext pythonContext, CodeContext context) bei IronPython.Runtime.PythonContext..ctor(ScriptDomainManager manager, IDictionary`2 options)

12.09.2015 11:54:37 - System.MissingMethodException - Methode nicht gefunden: "System.Object Microsoft.Scripting.Utils.ExceptionUtils.GetData(System.Exception, System.Object)".: bei IronPython.Runtime.Exceptions.PythonExceptions.GetFrameList(Exception e) bei IronPython.Runtime.Exceptions.PythonExceptions.GetDynamicStackFrames(Exception e) bei FreePIE.Core.ScriptEngine.Python.PythonScriptEngine.TriggerErrorEventNotOnPythonThread(Exception e) bei FreePIE.Core.ScriptEngine.Python.PythonScriptEngine.TriggerErrorEventNotOnPythonThread(Exception e) bei FreePIE.Core.ScriptEngine.Python.PythonScriptEngine.ExecuteSafe(Action action, Boolean logToFile) bei FreePIE.Core.ScriptEngine.Python.PythonScriptEngine.<>cDisplayClass5.b1(Object obj1) bei System.Threading.ThreadHelper.ThreadStart_Context(Object state) bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bei System.Threading.ThreadHelper.ThreadStart(Object obj)

AndersMalmgren commented 9 years ago

Strange, works on my machine here, windows 7 x64

cpupower commented 9 years ago

Hm... I just noticed this issue: https://github.com/IronLanguages/main/issues/1194 I had IronPython 2.7 installed. After uninstalling, the issue was still there, but after rebuilding the solution in Visual Studio the script runs without crashing.

Unfortunately the issue is still open, so it seems that people having IronPython installed are forced to uninstall it (the old version).

Edit: I tried to install the newest version of IronPython (2.7.5) and it works, too. So it seems to be only caused by older versions of IronPython.

AndersMalmgren commented 9 years ago

Could you please try to downgrade to 2.7.3 so that it crashes again,then copy the newer Microsoft.Dynamic assemblies to the FreePIE folder. This way it should not look in the GAC and it should work. If this works we should consider bundling the assemblies with FreePIE

edit: Hmm, we actually are bundlign Microsoft.Dynamic.dll and Microsoft.Scripting.dll, there must be a third assmebly that we do not bundle that causes this?

AndersMalmgren commented 8 years ago

Can I close this?

ajayyy commented 7 years ago

I just got this problem too. I am uninstalling IronPython now.

ajayyy commented 7 years ago

I am still getting the error, what do you mean by rebuilding the solution in Visual Studio? @cpupower

ajayyy commented 7 years ago

Nevermind, I figured it out.

The solution is to uninstall IronPython and restart FreePIE.