0
我正在C#中开发一个绘图应用程序,我打算使用IronPython作为应用程序的脚本扩展。我已经成功地使用了IronPython几个月,大多数用户没有任何问题,但是一小部分用户遇到问题。IronPython:TopNamespaceTracker.PublishComTypes引发AccessViolationException
在其中一个人的帮助下,我设法挖掘了异常堆栈跟踪。
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Reflection.TargetInvocationException:
Failed to load language 'IronPython 2.6.2': Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Microsoft.Scripting.Actions.TopNamespaceTracker.PublishComTypes(Assembly interopAssembly)
at IronPython.Runtime.Binding.PythonBinder.DomainManager_AssemblyLoaded(Object sender, AssemblyLoadedEventArgs e)
at IronPython.Runtime.Binding.PythonBinder..ctor(PythonContext pythonContext, CodeContext context)
at IronPython.Runtime.PythonContext..ctor(ScriptDomainManager manager, IDictionary`2 options)
--- End of inner exception stack trace ---
at Microsoft.Scripting.Runtime.LanguageConfiguration.LoadLanguageContext(ScriptDomainManager domainManager, Boolean& alreadyLoaded)
at Microsoft.Scripting.Runtime.DlrConfiguration.LoadLanguageContext(ScriptDomainManager manager, LanguageConfiguration config)
at Microsoft.Scripting.Runtime.DlrConfiguration.TryLoadLanguage(ScriptDomainManager manager, AssemblyQualifiedTypeName providerName, LanguageContext& language)
at Microsoft.Scripting.Runtime.ScriptDomainManager.GetLanguageByTypeName(String providerAssemblyQualifiedTypeName)
at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngineByTypeName(String assemblyQualifiedTypeName)
at IronPython.Hosting.Python.GetEngine(ScriptRuntime runtime)
我找不到在谷歌任何可能与此有关:当调用Python.CreateEngine()
方法发生异常。 有关用户环境中的某些信息:
- 的Win7 64位
- 使用.NET 2.0-3.5(不是4.0)
- IronPython的没有安装在GAC中,应用程序使用组件在本地磁盘上(V 2.6 0.2)
- 用户运行的应用程序作为普通用户(非管理员)
我用的Win7 64位自己,但我没有任何这样的问题。