OK the problem solved.
the keywords are: require path, name change.
I tried to make a C# DLL file look like:
namespace testdll
{
public class MyClass
{
public MyClass()
{
Console.Writeln("run test dll");
}
}
}
and the DLL name was: testdll.dll
in IronRuby project, the code I wrote:
require "testdll"
obj = testdll::MyClass.new
that was failed. because Module name of Ruby's first letter must be capitalized.
so I modified the testdll namespace to:
namespace TestDll
then the code in IR was:
obj = TestDll::MyClass.new
it's past.
then I think maybe ServiceStack.Redis was a "wrong" Module name ? so I tried:
namespace Test.Dll # in C#
...
obj = Test.Dll::MyClass.new
failed.
at that time I thought that I need to Wrap the ServiceStack.Redis to something like:
namespace Wrap
{
public class Redis : ServiceStack.Redis.SomeClass ...
}
but it's too complicated to be done and I view the original code in IR,
and I found the code:
require "System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
require "System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
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
namespace System.Drawing
so if we can use the code System::Drawing with namespace System.Drawing, why my code will fail ?
I tried changed require code from:
require "redis/ServiceStack.redis" to
require "ServiceStack.redis"
then:
object = ServiceStack::Redis::PooledRedisClientManager.new
....
Past !
important things are:
- do not require C# DLL with path related.
- in IR namespace A.B in C# DLL will rename module name to A::B