【发布时间】: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