C# IronRuby CreateScriptSourceFromFile找不到文件
我有一个非常简单的程序,用于从C调用.rb文件中的代码,但无法确定如何正确地形成CreateScriptSourceFromFile将接受的文件引用。以下是最新的化身:C# IronRuby CreateScriptSourceFromFile找不到文件,c#,interop,ironruby,C#,Interop,Ironruby,我有一个非常简单的程序,用于从C调用.rb文件中的代码,但无法确定如何正确地形成CreateScriptSourceFromFile将接受的文件引用。以下是最新的化身: using System; using System.Collections.Generic; using System.IO; using IronRuby; using Microsoft.Scripting.Hosting; namespace IronRubyFromCSharp { class Progra
using System;
using System.Collections.Generic;
using System.IO;
using IronRuby;
using Microsoft.Scripting.Hosting;
namespace IronRubyFromCSharp
{
class Program
{
static void Main(string[] args)
{
try
{
var rubyEngine = Ruby.CreateEngine();
var searchPaths = new List<String>();
searchPaths.Add(".");
searchPaths.Add(@"C:\sbgit\IRFromCS\IronRubyFromCSharp\Ruby\");
rubyEngine.SetSearchPaths(searchPaths);
var scriptSource = rubyEngine.CreateScriptSourceFromFile("hello.rb");
var codeText = scriptSource.GetCode();
Console.WriteLine(codeText);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.ReadLine();
}
}
}
我已经确认该文件存在,并且它包含有效的Ruby代码,但每次执行该文件时,当我尝试执行、编译甚至只是访问代码时,都会收到System.NotImplementedException
在CreateScriptSourceFromFile中引用代码文件的正确方法是什么
使用zip版本的dllIronRuby.dll和Microsoft.Scripting.dll我不明白你的意思。我已经安装了IronRuby,这就是我使用的安装程序。@Jekke敢先尝试,然后再谈。System.NotImplementedException不是System.IO.FileNotFoundException