It would be useful to supply the exact error message, but this is almost 
certainly a CLR loader issue. You can't really treat CLR assemblies like Ruby 
source files; the loader has very specific rules and its semantics don't match. 
In particular, loading assemblies from an explicitly-specified full path is 
asking for trouble.

I can't remember if IronRuby has implemented the same kind of assembly loader 
hook as IronPython, but if it has, you might be able to solve this by updating 
your search path to include the build directory and then doing the require 
without a directory name.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Mario A Chavez
Sent: Tuesday, July 07, 2009 9:44 PM
To: [email protected]
Subject: [Ironruby-core] IR 0.6.0 error loading a c# class

Hi;

I have a custom C# Assembly1 which have interface ISomething and a C# Assembly2 
which have class Something, and this class implements the interface like:

public class Something : ISomething { }

Using iirb I try to create an instace of that class but it complains about the 
class not being defined, I do use iirb as follow:

requiere 'mscorlib'
requiere 'System'

require File.dirname(__FILE__) + '/build/assembly1.dll'
require File.dirname(__FILE__) + '/build/assembly2.dll'

include Assembly1
include Assembly2

@s = Something.new
<-- Here it fails telling me that the class is not defined, but if I remove the 
code that implements the interface, it just works fine. My guess is that 
somehow is not resolving the interface, but I'm not sure how can I fix this.

Thanks

Mario Alberto Chávez
[email protected]<mailto:[email protected]>
http://mario-chavez.blogspot.com/




_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to