[Ironruby-core] Using .Net cascade assemblies

Alexander Ranger lists at ruby-forum.com
Tue Aug 14 05:41:19 UTC 2012


Hello.

I've got 2 .Net assemblies, for example, Foo.dll and Boo.dll

Boo contains
namespace BooModule
{
  public class Boo
  {
    public string Speak()
    {
      return "Hello from class Boo";
    }
  }

  public interface IFoo
  {
    string Comment();
  }
}

Foo contains

namespace FooModule
{
  public class Foo : IFoo
  {
    public string Comment()
    {
      return "Class Foo inhereted from IFoo";
    }
  }
}

In IronRuby console I try:

IronRuby 1.1.3.0 on .NET 4.0.30319.239
Copyright (c) Microsoft Corporation. All rights reserved.

>>> require 'D:\Programs\Univeris\FooBoo\bin\Boo'
=> true
>>> include BooModule
=> Object
>>> require 'D:\Programs\Univeris\FooBoo\bin\Foo'
=> true
>>> include FooModule
(ir):1:in `const_missing': uninitialized constant Object::FooModule
(NameError)
        from (ir):1

If I inherit Foo : Boo I get the same error.

But if I move the declaration to the Foo propject, so it's like

namespace FooModule
{
  public interface IFoo
  {
    string Comment();
  }

  public class Foo : IFoo
  {
    public string Comment()
    {
      return "Class Foo inhereted from IFoo";
    }
  }
}

Everything works just fine.

IronRuby 1.1.3.0 on .NET 4.0.30319.239
Copyright (c) Microsoft Corporation. All rights reserved.

>>> require 'D:\Programs\Univeris\FooBoo\bin\Foo'
=> true
>>> include FooModule
=> Object
>>> foo = Foo.new
=> FooModule.Foo
>>> foo.Comment
=> 'Class Foo inhereted from IFoo'


But I've got a really huge program system that consists of several big
dll libraries which I want to use via IronRuby and I just can't move all
those libraries into one dll file and into one namespace.


What am I doing wrong?

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


More information about the Ironruby-core mailing list