[Ironruby-core] WatiN .NET 4.0 and the loadFromRemoteSources Element in App.config

Ivan Porto Carrero ivan at cloudslide.net
Mon Jun 21 13:45:24 EDT 2010


The load path basically determines where ir.exe looks for assemblies and
files to load.

if you do

$LOAD_PATH.unshift(File.dirname(__FILE__) +"/bin/Debug")
and then require Watin.Core.dll the CLR knows where to look for your DLL's
including the referenced assemblies

You might have gotten a correct result by including your assemblies in the
inverted order too

So either you do :

$LOAD_PATH.unshift(File.dirname(__FILE__) +"/bin/Debug")
require 'BusinessObjects.dll'
require 'WatiN.Core.dll'

or this might work too:

require File.dirname(__FILE__) +"/bin/Debug/Interop.SHDocVw.dll"
require File.dirname(__FILE__) +"/bin/Debug/Microsoft.mshtml.dll"
require File.dirname(__FILE__) +"/bin/Debug/BusinessObjects.dll"
require File.dirname(__FILE__) +"/bin/Debug/WatiN.Core.dll"

---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero

On Mon, Jun 21, 2010 at 6:54 PM, Mohammad Azam <lists at ruby-forum.com> wrote:

> Ivan Porto Carrero wrote:
> > instead of requiring the files with path. maybe try to set the load path
> >
> > $:.unshift( File.dirname(__FILE__) + "/bin/Debug")
> > require 'BusinessObjects.dll'
> > require 'WatiN.Core.dll'
> > require 'Microsoft.mshtml.dll'
> > require 'Interop.SHDocVw.dll'
> >
> > I also think that the last 2 are redundant.. they should get picked up
> > automatically by Watin.Core isn't it
> > ---
> > Met vriendelijke groeten - Best regards - Salutations
> > Ivan Porto Carrero
> > Web: http://whiterabbitconsulting.eu - http://flanders.co.nz
> > Twitter: http://twitter.com/casualjim
> > Author of IronRuby in Action (http://manning.com/carrero)
> > Microsoft IronRuby/C# MVP
>
>
> You are right! It should be loaded automatically but for some reason it
> is not. Here is my IronRuby code:
>
>
> require 'rubygems'
> require 'spec'
>
> require File.dirname(__FILE__) + '/bin/Debug/BusinessObjects.dll'
> require File.dirname(__FILE__) + '/bin/Debug/WatiN.Core.dll'
>
> include BusinessObjects
> include WatiN
>
> describe Account, "when something happens" do
>
> before do
>
> IE = WatiN::Core::IE
>
> i = IE.new()
>
> end
>
> it "should do something" do
>
>
>
> end
>
> end
>
>
>
> And here is the error I get:
>
> C:\Projects\TestingIronRuby\BusinessObjects\BusinessObjects>ir -S spec
> testaccou
> ntbalanceUI.rb
> F
>
> 1)
> Errno::ENOENT in 'BusinessObjects::Account when something happens should
> do some
> thing'
> Could not load file or assembly 'Interop.SHDocVw, Version=1.1.0.0,
> Culture=neutr
> al, PublicKeyToken=db7cfd3acb5ad44e' or one of its dependencies. The
> system cann
> ot find the file specified.
> ./testaccountbalanceUI.rb:19:
>
> Finished in 0.150009 seconds
>
> 1 example, 1 failure
>
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100621/3d4af432/attachment-0001.html>


More information about the Ironruby-core mailing list