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

Mohammad Azam lists at ruby-forum.com
Tue Jun 9 22:31:00 EDT 2009


Curt Hagenlocher wrote:
> If this is C# 4 (as you've suggested in another email), you should be 
> able to say
> 
> object personClass = engine.Runtime.Globals.GetVariable("Person");
> dynamic person = engine.ObjectOperations.CreateInstance(personClass);
> person.greet();


I tried and it did not work out.

First engine does not have ObjectOperations. There is engine.Operations 
which I used but I get the error when doing person.greet().

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

Error  73  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  80  13 
ConsoleApplication1


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


More information about the Ironruby-core mailing list