a.wilson82 at gmail.com
Sat Jan 16 03:41:03 EST 2010
So I decided to debug this out a bit for myself. Before I go too far, here
is how my require headers are setup:
require 'System.Xml.Linq, Version=126.96.36.199, Culture=neutral,
require 'System.Data.DataSetExtensions, Version=188.8.131.52, Culture=neutral,
require 'System.Data, Version=184.108.40.206, Culture=neutral,
require 'System.Xml, Version=220.127.116.11, Culture=neutral,
require 'System.Drawing, Version=18.104.22.168, Culture=neutral,
require 'System.Windows.Forms, Version=22.214.171.124, Culture=neutral,
Inside of my IronRuby specs, there is a call that, in ruby looks like this:
rargs = ['-o', 'C:\Users\pinvoke']
args = System::Array[System::String].new(rargs)
p = Rspec::Project::Runner::ProgramArguments.Parse(args)
The call to assign the results of Parse to P always fails unless I
a) Do what Ivan suggested and copy to the bin folder
b.) Modify ir.exe.config to include the path to the actual .dll
I was reading the source code this evening and noticed that during the
RubyContext buildup it only includes the following paths to resolve
I assumed this is was why if I dump my .dll into any of those paths it
Then when I looked at the loaded files, everything looked like it loaded
: "System.Xml.Linq, Version=126.96.36.199, Culture=neutral,
: "System.Data.DataSetExtensions, Version=188.8.131.52, Culture=neutral,
: "System.Data, Version=184.108.40.206, Culture=neutral,
: "System.Xml, Version=220.127.116.11, Culture=neutral,
: "System.Drawing, Version=18.104.22.168, Culture=neutral,
: "System.Windows.Forms, Version=22.214.171.124, Culture=neutral,
Here is where it gets fun!
The problem appears to be in the way IronRuby is resolving assembly
references from other already loaded assemblies. That is, if I make the
above spec calls (rargs /args/ p) the application blows up w/o the CmdParser
assembly in the path. The thing is that all the .Parse(args) method call is
doing is a wrapper to call into another assembly... the one that blows up as
not being found.
So, I decided to see what happened if I call the methods from the CmdParser
assembly directly and... everything works fine. Regardless of which path
the file is in :)
If I wasn't so tired I would try and trace back how the resolve was working
and why it wasn't checking the loaded files... however I am exhausted and
it's way past my bed time.
If this helps, here is the Fusion Log that got dumped:
=== Pre-bind state information ===
LOG: User = veritas\pinvoke
LOG: DisplayName = CmdParser, Version=126.96.36.199, Culture=neutral,
LOG: Appbase = file:///F:/ironruby-ironruby-178b744/Merlin/Main/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
LOG: This bind starts in default load context.
LOG: Using application configuration file:
LOG: Using machine configuration file from
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
When I wrote this, only God and I understood what I was doing. Now, God
only knows - Karl Weierstrass
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ironruby-core