首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IronPython: TopNamespaceTracker.PublishComTypes throws

IronPython: TopNamespaceTracker.PublishComTypes throws
EN

Stack Overflow用户
提问于 2011-08-06 16:46:13
回答 1查看 196关注 0票数 0

我正在C#中开发一个制图应用程序,我计划使用IronPython作为应用程序的脚本扩展。我已经成功地使用IronPython几个月了,大多数用户对它没有任何问题,但是有一小部分用户有问题。

在其中一个人的帮助下,我设法挖掘出异常堆栈跟踪。此异常发生在调用Python.CreateEngine()方法时:

代码语言:javascript
复制
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)

我在谷歌上找不到任何与此相关的信息。关于用户环境的一些信息:

  • Win7 64位
  • 使用.NET 2.0-3.5 (非4.0)
  • IronPython未安装在GAC中,应用程序在磁盘上使用本地程序集(v2.6.2)
  • 用户以普通用户身份运行应用程序(而不是
  • IronPython)

我自己使用Win7 64位,但我没有这样的问题。

EN

回答 1

Stack Overflow用户

发布于 2011-08-08 16:11:24

异常发生在IronPython的COM互操作代码中,但我不完全确定原因--发生异常的代码将COM类型从互操作程序集中提取出来。当异常发生时,您必须(不知怎么地)弄清楚在AppDomain中加载了什么程序集,这可能需要实时调试或定制的IronPython构建。

我不确定这是IronPython中的错误,还是用户机器上有一个令人毛骨悚然的COM对象导致IronPython崩溃,但我猜是后者。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6968231

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档