Welcome to the "wonderful" world of Fusion.<div><br></div><div>If you use Assembly.LoadFrom, then you can only use the assembly reference itself to get the types. The canonical names don't match assemblies loaded using LoadFrom. To use Assembly.Load, it has to be in one of the approved search paths (which, by default, is the path of the launching executable only, plus the GAC of course).</div>
<div><br></div><div>We went through an almost excruciating amount of pain with assembly load paths and such to make all this work correctly in xUnit.net.<br clear="all"><br>--<br>Brad <a href="http://bradwilson.typepad.com/">http://bradwilson.typepad.com/</a><br>
<br><br><div class="gmail_quote">On Mon, Dec 8, 2008 at 12:33 PM, Aaron Feng <span dir="ltr"><<a href="mailto:aaron.feng@gmail.com">aaron.feng@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<span style="color:rgb(0, 0, 0)">Ok, I got </span><span style="font-size:11pt;color:rgb(0, 0, 0)">Assembly.Load and </span><span style="font-size:11pt;color:rgb(31, 73, 125)"><span style="color:rgb(0, 0, 0)">Type.get_type both to work with my own DLL. The actual DLL have to live where ir.exe lives. Is there a way for it to look in the directory of the ruby file? Like the way require statement work.<br>
<br>Aaron<br></span><br><br></span><br><div class="gmail_quote">On Mon, Dec 8, 2008 at 2:11 PM, Tomas Matousek <span dir="ltr"><<a href="mailto:Tomas.Matousek@microsoft.com" target="_blank">Tomas.Matousek@microsoft.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">Can you load the assembly and get the type explicitly?</span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)"> </span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">require 'mscorlib'</span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">System::Reflection::Assembly.Load("IronNails.Library,
Version=<a href="http://1.0.0.0" target="_blank">1.0.0.0</a>, Culture=neutral, PublicKeyToken=null").GetType(</span>'IronNails.View.XamlProxy')<span style="font-size:11pt;color:rgb(31, 73, 125)"></span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)"> </span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)">Tomas</span></p>
<p><span style="font-size:11pt;color:rgb(31, 73, 125)"> </span></p>
<div style="border-style:solid none none;border-color:rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color;border-width:1pt medium medium;padding:3pt 0in 0in">
<p><b><span style="font-size:10pt">From:</span></b><span style="font-size:10pt"> <a href="mailto:ironruby-core-bounces@rubyforge.org" target="_blank">ironruby-core-bounces@rubyforge.org</a>
[mailto:<a href="mailto:ironruby-core-bounces@rubyforge.org" target="_blank">ironruby-core-bounces@rubyforge.org</a>] <b>On Behalf Of </b>Ivan Porto
Carrero<br>
<b>Sent:</b> Monday, December 08, 2008 9:46 AM<div><br>
<b>To:</b> <a href="mailto:ironruby-core@rubyforge.org" target="_blank">ironruby-core@rubyforge.org</a><br>
</div><b>Subject:</b> Re: [Ironruby-core] Handling C# lower case namespaces</span></p>
</div><div><div></div><div>
<p> </p>
<p style="margin-bottom:12pt">I get the same behavior.<br>
I can load types from the CLR but not from my own assembly.<br>
<br>
I copied my assembly into the folder that contains ir.exe<br>
<br>
>>> require 'mscorlib'<br>
=> true<br>
>>> require 'IronNails.Library, Version=<a href="http://1.0.0.0" target="_blank">1.0.0.0</a>,
Culture=neutral, PublicKeyToken=null'<br>
=> true<br>
>>> IronNails::View::XamlProxy<br>
=> IronNails::View::XamlProxy<br>
>>> System::Type.get_type 'IronNails.View.XamlProxy'<br>
=> nil<br>
>>> System::Type.get_type 'System.String'<br>
=> #<System::RuntimeType:0x000005c><br>
>>> IronNails::View::XamlProxy.to_clr_type<br>
=> #<System::RuntimeType:0x000005e><br clear="all">
<br>
<br>
<br>
</p>
<div>
<p>On Mon, Dec 8, 2008 at 5:54 PM, Aaron Feng <<a href="mailto:aaron.feng@gmail.com" target="_blank">aaron.feng@gmail.com</a>> wrote:</p>
<p style="margin-bottom:12pt">Tomas,<br>
<br>
I tried it again. I couldn't get the following to work with my own DLL
even If I capitalize the namespace (It does work fine with build in types like
System.String):<br>
<br>
> <span style="font-size:11pt;color:rgb(31, 73, 125)">System::Type.get_type("Abc.Hi,
Version=<a href="http://1.0.0.0" target="_blank">1.0.0.0</a>, Culture=neutral,
PublicKeyToken=null")<br>
<br>
</span>Do I have any other options?<br>
<br>
Thanks,<br>
<span style="color:rgb(136, 136, 136)"><br>
Aaron<br>
</span><br>
_______________________________________________<br>
Ironruby-core mailing list<br>
<a href="mailto:Ironruby-core@rubyforge.org" target="_blank">Ironruby-core@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a></p>
</div>
<p> </p>
</div></div></div>
</div>
<br>_______________________________________________<br>
Ironruby-core mailing list<br>
<a href="mailto:Ironruby-core@rubyforge.org" target="_blank">Ironruby-core@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a><br>
<br></blockquote></div><br>
<br>_______________________________________________<br>
Ironruby-core mailing list<br>
<a href="mailto:Ironruby-core@rubyforge.org">Ironruby-core@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a><br>
<br></blockquote></div><br></div>