我应该在我的应用程序的安装程序中包含IronPython DLL吗?

时间:2018-06-13 01:06:20

标签: c# dll ironpython

我对使用DLL有点新意,我不知道该怎么办。

我有一个C#应用程序,它通过IronPython提供python API。截至目前,我的应用程序的安装程序包含必要的IronPython DLL,因此解释器开箱即用。但是DLL上只包含几个python模块。要获得其余的python模块,用户需要安装IronPython。

当安装程序IronPython版本与我的应用程序附带的DLL不同时,我遇到了一些问题,例如the one described here。我能够通过强制我的应用程序加载随其安装的DLL来解决问题。我的应用程序包含来自IronPython 2.7.6.3的DLL,今天我遇到了一个问题。在新系统上安装我的应用程序时,我安装了IronPython 2.7.8(最新版本),我开始收到此错误:

    import logging
  File "C:\Program Files\ironPython 2.7\Lib\logging\__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "C:\Program Files\ironPython 2.7\Lib\weakref.py", line 14, in <module>
    from _weakref import (
ImportError: Cannot import name _remove_dead_weakref

与2.7.6.3不同的其他IronPython版本适用于我的应用程序,但不适用于2.7.8。

所以这就是问题。我是否通过将IronPython DLL包含在我的应用程序安装程序中来遵循正确的方法,还是应该不包含任何内容? 我想知道如果我没有包含任何DLL,我是否会遇到这些兼容性问题。这将要求用户在他们想要使用我的应用程序中的python API时始终安装IronPython。

0 个答案:

没有答案