I have an IronRuby script hosted in a C# application in Visula Studio 2010. I set a breakpoint on a line of a class method in the script, but it would never be hit when debugging the code in VS. Is this a bug, or am I doing something wrong?
using System;
using System.Collections.Generic;
using IronRuby;
using IronRuby.Builtins;
using Microsoft.Scripting.Hosting;
namespace RubyInterOP
{
class Program
{
public static void Main(string[] args)
{
var setup = new ScriptRuntimeSetup();
setup.DebugMode = true;
setup.AddRubySetup();
var runtime = Ruby.CreateRuntime(setup);
ScriptScope scope = null;
ScriptEngine engine = null;
engine = runtime.GetRubyEngine();
scope = Ruby.CreateRuntime().CreateScope();
ICollection<string> paths = new List<string>();
paths.Add(@"C:\Users\tau\Documents\Visual Studio 2010\Projects\RubyInterOP\RubyInterOP");
engine.SetSearchPaths(paths);
engine.ExecuteFile(@"C:\Users\tau\Documents\Visual Studio 2010\Projects\RubyInterOP\RubyInterOP\Class1.rb");
object rubyClass = engine.Runtime.Globals.GetVariable("Class1");
object mainForm = engine.Operations.CreateInstance(rubyClass);
engine.Operations.InvokeMember(mainForm, "ABC");
}
}
}
Ruby file:
class Class1
def initialize()
end
def ABC()
# add breakpoint here
puts "ABC"
end
end