[Ironruby-core] Accessing a Module's Classes from C# with dynamic

Joshua M. lists at ruby-forum.com
Sat Jan 15 16:15:59 EST 2011


>You need to include the Module if you want to
>access the class without qualifying it.

I have tried this but it doesn't work (RuntimeBinderException:
'Microsoft.Scripting.Hosting.ScriptScope' does not contain a definition
for 'Foo').

In my original post I had specified the fully qualified name.

>RbScriptApp.const_get("Foo")

InvalidOperationException: Empty scope has no global scope.

>I haven't tried that, but I think it should work. Neither solution is
>indeed ideal. CLR interop with Modules isn't quite polished yet.

Ah, that would explain it. I guess I'll hold off on integrating IronRuby
just yet.

--

Thank you both for your time.

-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list