views:

215

answers:

2

How to call a C# dll in ruby?

A: 

With IronRuby http://ironruby.net/

BJ Clark
+3  A: 

I can think of a few possibilities:

  • Write (or get someone to write) a COM wrapper for your DLL, if it doesn't already have one, then use Ruby's WIN32OLE library to call it;
  • Take a look at RubyCLR, one of the authors of which was John Lam, who went on to work on IronRuby at Microsoft. (I don't think it's maintained any longer, and it may not support .Net versions above 2.0);
  • As already mentioned elsewhere, look at using IronRuby, if that's a technical option for you.

There's a thread on the topic here. Note that the last post is actually from John Lam (looks like March 2009) where he seems comfortable asserting that RubyCLR is still functional...

Mike Woodhouse