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

Curt Hagenlocher curth at microsoft.com
Tue Jun 9 23:29:18 EDT 2009

Yes, sorry, you're right -- it's Engine.Operations (but the name of the class is "ObjectOperations").

The error message tells you exactly what you need to do! Make sure you've added references to Microsoft.CSharp.dll and System.Core.dll to your project.

-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Mohammad Azam
Sent: Tuesday, June 09, 2009 7:31 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] How to fire IronRuby Method from C#

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 

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 

Posted via http://www.ruby-forum.com/.
Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list