# Ruby and C# Integration

**URL:** <https://www.ruby-forum.com/t/ruby-and-c-integration/118237>\
**Category:** Ruby\
**Created:** [October 25, 2007, 12:59am UTC](https://www.ruby-forum.com/t/ruby-and-c-integration/118237 "2007-10-25T00:59:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![moonshot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9f8e36/32.png) [@moonshot](https://www.ruby-forum.com/u/moonshot)\
**Post date:** [October 25, 2007, 12:59am UTC](https://www.ruby-forum.com/t/ruby-and-c-integration/118237/1 "2007-10-25T00:59:05Z")

</div>

Does anyone know of a way or have any links for how to integrate c# and  
ruby? I’d like to be able to write ruby scripts for testing and have  
them talk to my c# program.

Thanks.

---

<div class="post-metadata">

**Author:** ![moonshot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9f8e36/32.png) [@moonshot](https://www.ruby-forum.com/u/moonshot)\
**Post date:** [October 25, 2007, 2:00am UTC](https://www.ruby-forum.com/t/ruby-and-c-integration/118237/2 "2007-10-25T02:00:08Z")

</div>

Search IronRuby in the forums/google.

Regards

---

<div class="post-metadata">

**Author:** ![moonshot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9f8e36/32.png) [@moonshot](https://www.ruby-forum.com/u/moonshot)\
**Post date:** [October 25, 2007, 2:05am UTC](https://www.ruby-forum.com/t/ruby-and-c-integration/118237/3 "2007-10-25T02:05:59Z")

</div>

On 10/24/07, Jayson B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Does anyone know of a way or have any links for how to integrate c# and  
> ruby? I’d like to be able to write ruby scripts for testing and have  
> them talk to my c# program.

some links:  
[http://rubyforge.org/projects/rubyclr/](http://rubyforge.org/projects/rubyclr/)  
(unfortunately, pretty much dead since):  
[http://www.ironruby.net/](http://www.ironruby.net/)  
also, see:  
[http://plas2003.fit.qut.edu.au/Ruby.NET/](http://plas2003.fit.qut.edu.au/Ruby.NET/)

also:  
[http://raa.ruby-lang.org/project/ruby-mono/](http://raa.ruby-lang.org/project/ruby-mono/)  
or:  
[SaltyPickle.com is for sale | HugeDomains](http://www.saltypickle.com/RubyDotNet)

I have used rubyclr and ruby-mono.

---

<div class="post-metadata">

**Author:** ![moonshot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9f8e36/32.png) [@moonshot](https://www.ruby-forum.com/u/moonshot)\
**Post date:** [October 26, 2007, 12:16pm UTC](https://www.ruby-forum.com/t/ruby-and-c-integration/118237/4 "2007-10-26T12:16:10Z")

</div>

Jayson B. wrote:

> Does anyone know of a way or have any links for how to integrate c# and  
> ruby? I’d like to be able to write ruby scripts for testing and have  
> them talk to my c# program.
> 
> Thanks.

I’ve been wrestling this problem quite a bit lately.  
The Ruby Bridge plugin by the Saphire Steel guys looks pretty good but  
it has one drawback:  
It expects the interpreter to be installed somewhere. This makes  
distribution of your app a two step process (install ruby, install app).  
This has proven a reason _not_ to use the plugin in my work, even though  
it gives you complete access to the Ruby objects.  
I opted for making an exe out of my ruby code (with rubyscript2exe) and  
using System.Diagnostics.Process to call it.  
Interaction is in one case through stdin, stdout (make sure you use the  
events of Process and read asynchronously otherwise the stdout buffer  
gets full and blocks the process) .  
In the other case it was trivial (from the Ruby side…from the C# side  
it took a bit more - but then I am more accomplished in Ruby than C#) to  
setup a TCP connection and pipe data through.  
One crazy idea that comes to mind is to make the inner Ruby app host a  
webserver and imlpement a REST interface to call from the C# code. More  
of an intresting exercise than a very practical implementation method I  
guess.  
Until IronRuby reaches 1.0Cheers,  
V.-

---

<div class="post-metadata">

**Author:** ![moonshot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9f8e36/32.png) [@moonshot](https://www.ruby-forum.com/u/moonshot)\
**Post date:** [October 25, 2007, 2:59pm UTC](https://www.ruby-forum.com/t/ruby-and-c-integration/118237/5 "2007-10-25T14:59:00Z")

</div>

Jayson,

This may help if you use Visual Studio 2005…

Go to [http://www.sapphiresteel.com/](http://www.sapphiresteel.com/) and get their free plug-in that will  
allow you to create windows forms and talk to Matz’s Ruby 1.8.6 on the  
back-end.

They specialize in a VS2005 plug-in for Ruby development, but have a  
free version, and the windows forms plug-in is free as well.

Bill
