I using C# DLL ServiceStack.redis in IronRuby. Form Designer was SharpDevelop. the code is:
require 'redis/ServiceStack.Redis' # redis is subfolder in project
...
def Button1Click(sender, e)
object = ServiceStack::Redis.PooledRedisClientManager.new
end
and the error message was:
System.MissingMethodException: undefined method `PooledRedisClientManager' for ServiceStack::Redis:Module
but in dotPeek, I can see the C# code was:
namespace ServiceStack.Redis
{
public class PooledRedisClientManager
{
...
public PooledRedisClientManager()
: this("localhost")
{
}
}
}
How can I import the C# DLL and use in IronRuby ?
OK the problem solved.
the keywords are: require path, name change.
I tried to make a C# DLL file look like:
and the DLL name was: testdll.dll in IronRuby project, the code I wrote:
that was failed. because Module name of Ruby's first letter must be capitalized.
so I modified the testdll namespace to:
then the code in IR was:
it's past.
then I think maybe ServiceStack.Redis was a "wrong" Module name ? so I tried:
failed. at that time I thought that I need to Wrap the ServiceStack.Redis to something like:
but it's too complicated to be done and I view the original code in IR, and I found the code:
and we can use : System::Drawing::Point ... so I view the System.Drawing DLL in dotPeek, I found the code familiar just like ServiceStack.xxx
so if we can use the code System::Drawing with namespace System.Drawing, why my code will fail ? I tried changed require code from:
then:
.... Past ! important things are: