當我參考最新版本的Microsoft.Scripting(IronPython附帶的一個)時,我在Visual Studio中收到警告。是否可以在同一個應用程序中並排使用IronPython和IronRuby?
是否可以在同一應用程序中並排部署/使用它們? 是否有更好/更動態的方式來實例化運行時?
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.
你有沒有嘗試將它們分成不同的項目(一個for ironruby和另一個for ironpython),然後引用你的主項目?或者,如果您只打算使用一個(取決於輸入),那麼只需在運行時動態加載程序集。 – 2011-03-17 20:34:47
似乎就像http://stackoverflow.com/questions/5238989/embedding-both-ironruby-and-ironpython – 2011-03-17 22:00:16