[Ironruby-core] How to fire IronRuby Method from C#

Mohammad Azam lists at ruby-forum.com
Wed Jun 10 13:50:21 EDT 2009


This is very strange! I copy pasted your code and it is giving me 
compile time errors:

Here is the code:

  var rubyPerson = (engine.Execute(@"

           require 'open-uri'

           class Person


           def greet()
           puts 'hello world'
           end

           end

          Person.new()

            "));

           object personClass = 
engine.Runtime.Globals.GetVariable("Person");
           dynamic person = 
engine.Operations.CreateInstance(personClass);

           person.greet();

And here is the error:

Error  1  Missing compiler required member 
'Microsoft.CSharp.RuntimeBinder.CSharpBinaryOperationBinder..ctor' 
ConsoleApplication1

Error  61  One or more types required to compile a dynamic expression 
cannot be found. Are you missing references to Microsoft.CSharp.dll and 
System.Core.dll?  C:\Documents and Settings\AzamSharp\My 
Documents\Visual Studio 
10\Projects\testvs2010\ConsoleApplication1\Program.cs  56  12 
ConsoleApplication1


I have already added references to both the dll libraries.


-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list