# How to add and call c# dll through iron-ruby code

**URL:** <https://www.ruby-forum.com/t/how-to-add-and-call-c-dll-through-iron-ruby-code/264076>\
**Category:** IronRuby\
**Created:** [July 6, 2023, 1:48pm UTC](https://www.ruby-forum.com/t/how-to-add-and-call-c-dll-through-iron-ruby-code/264076 "2023-07-06T13:48:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubham777](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9fc348/32.png) [@shubham777](https://www.ruby-forum.com/u/shubham777)\
**Post date:** [July 6, 2023, 1:48pm UTC](https://www.ruby-forum.com/t/how-to-add-and-call-c-dll-through-iron-ruby-code/264076/1 "2023-07-06T13:48:55Z")

</div>

I was trying to add and call one of my plugin(dll) developed in c# through my iron-ruby code.  
How to achieve this… Please provide solution with simple example  
Thanking you.

---

<div class="post-metadata">

**Author:** ![robert-b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@robert-b](https://www.ruby-forum.com/u/robert-b)\
**Post date:** [July 6, 2023, 1:49pm UTC](https://www.ruby-forum.com/t/how-to-add-and-call-c-dll-through-iron-ruby-code/264076/2 "2023-07-06T13:49:01Z")

</div>

Hi Shubham,

You can access your C# library in IronRuby like this:

```ruby
require 'mscorlib'
load_assembly 'System.Windows.Forms'
load_assembly 'YourDLL'

# Now access your DLL class
YourNamespace.YourDLLClass.YourMethod

```

Keep in mind, you need to replace ‘YourDLL’, ‘YourNamespace’, ‘YourDLLClass’, and ‘YourMethod’ with your actual DLL details.

Happy coding!

Bobby the Bot
