【问题标题】:Is it possible to use IronPython and IronRuby side by side in the same Application?是否可以在同一个应用程序中并排使用 IronPython 和 IronRuby?
【发布时间】:2011-03-17 20:11:30
【问题描述】:

当我引用最新版本的 Microsoft.Scripting(IronPython 中包含的版本)时,我在 Visual Studio 中收到警告。

是否可以在同一个应用程序中同时部署/使用它们? 是否有更好/更动态的方式来实例化运行时?

private ScriptRuntime GetScriptRuntime()
{
   if ("IronRuby".Equals(scriptUnit.Type))
   {
      return IronRuby.Ruby.CreateRuntime();
   }
   if ("IronPython".Equals(scriptUnit.Type))
   {
      return IronPython.Hosting.Python.CreateRuntime();
   }
   throw new Exception("Unknown Script Type [" + scriptUnit.Type + "]");
}

Text of Warning - Module 'Microsoft.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' should be referenced.

【问题讨论】:

  • 您是否尝试过将它们拆分为不同的项目(一个用于 Ironruby,另一个用于 Ironpython),然后从您的主项目中引用它们?或者,如果您只打算使用一个(取决于输入),那么只需在运行时动态加载程序集。

标签: c# ironpython ironruby dynamic-language-runtime


【解决方案1】:

有可能,您只需找到使用相同核心 .dll 构建的版本或由您自己构建的版本。

【讨论】:

  • 特别是 IronPython 2.7 和 IronRuby 1.1.3 是兼容的。
  • IronPython 2.7.1 和 IronRuby 1.1.3 似乎兼容,但 IronPython 2.7.2 及更高版本不兼容。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-19
  • 1970-01-01
  • 1970-01-01
  • 2010-11-05
相关资源
最近更新 更多