我用C#编写了一小段非常简单的代码,它可以加载并执行Ruby脚本。它看起来是这样的:
using System;
using System.Collections.Generic;
using System.IO;
using IronRuby;
using Microsoft.Scripting;
namespace RubyCaller
{
class Program
{
static void Main(string[] args)
{
var rubyEng = Ruby.CreateEngine();
rubyEng.ExecuteFile(@".\Scripts\hello.rb");
Console.ReadLine();
}
}
}Ruby代码是一个简单的Hello World,在IR.exe中和使用rubyEng.Execute()执行时都可以很好地执行。当我尝试以这种方式执行它时,在调用ExecuteFile时得到"NotImplementedException“。
我遗漏了什么?
发布于 2012-02-17 12:19:09
在最新版本的IronRuby上对我有效。你能为你得到的异常提供堆栈跟踪吗?另外,你确定你使用的是针对.NET框架的IronRuby程序集,而不是针对Windows phone7或Silverlight的吗?
https://stackoverflow.com/questions/8012560
复制相似问题