Я разрабатываю картографическое приложение на C # и планирую использовать IronPython в качестве расширения приложения для создания сценариев. Я успешно использую IronPython в течение нескольких месяцев, и у большинства пользователей нет проблем с ним, но у небольшого процента пользователей возникают проблемы.
С помощью одного из них мне удалось выкопать трассировку стека исключений. Исключение возникает при вызове метода Python.CreateEngine()
:
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)
Я не смог найти в Google ничего, что могло бы быть связано с этим.
Некоторая информация о среде пользователя:
- Win7 64bit
- Использование .NET 2.0-3.5 (не 4.0)
- IronPython не установлен в GAC, приложение локально использует сборки на диске (v 2.6.2)
- Пользователь запускает приложение как обычный пользователь (не администратор)
Я сам использую Win7 64bit, но у меня не было таких проблем.