Ben Hall
2008-Jun-23 01:43 UTC
[Ironruby-core] Improved error handling if IronRuby.Libraries is not referenced
Hi, This might sound like an odd request, but it has just caught me out. Basically, I wanted to host IronRuby within a Console Application (for a demo), however I didn''t reference IronRuby.Libraries, as a result I was getting the exception - System.MissingMethodException was unhandled Message="1::+ (the code was "puts 1+1"). This was my thought process: 1) Created a new project. Reference DLR assemblies. 2) Create new Runtime and Engine (using rb). Exception - missing IronRuby reference. Forgot, lets reference that. 3) Execute, method missing exception thrown. 4) Confused. Looked back at my IronEditor code - realised I was missing IronRuby.Librarires. 5) Added reference - everything worked. Maybe it''s not required, but is there any way of better error handling in this situation? Thanks Ben
Peter Bacon Darwin
2008-Jun-23 13:22 UTC
[Ironruby-core] Improved error handling if IronRuby.Libraries is not referenced
I think you''ll find that in the future, the IronRuby.Libraries assembly will be merged into the IronRuby language assembly and so will not need to be referenced. By the way, can you get your program to work without referencing the assembly in the project but by just copying the assembly into the folder containing your executable? Pete -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ben Hall Sent: Monday,23 June 23, 2008 02:44 To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Improved error handling if IronRuby.Libraries is not referenced Hi, This might sound like an odd request, but it has just caught me out. Basically, I wanted to host IronRuby within a Console Application (for a demo), however I didn''t reference IronRuby.Libraries, as a result I was getting the exception - System.MissingMethodException was unhandled Message="1::+ (the code was "puts 1+1"). This was my thought process: 1) Created a new project. Reference DLR assemblies. 2) Create new Runtime and Engine (using rb). Exception - missing IronRuby reference. Forgot, lets reference that. 3) Execute, method missing exception thrown. 4) Confused. Looked back at my IronEditor code - realised I was missing IronRuby.Librarires. 5) Added reference - everything worked. Maybe it''s not required, but is there any way of better error handling in this situation? Thanks Ben _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Ben Hall
2008-Jun-23 13:29 UTC
[Ironruby-core] Improved error handling if IronRuby.Libraries is not referenced
In another one of my applications, I am loading the assemblies dynamically (they are not referenced). With IP Beta 3, I changed the way I load assemblies (Using LanguageSetup? Look in the IronPython mailing list for details, it was posted there). Can''t remember how I deal with both assemblies (thats what 2am coding gets you), or if they just work because they are in the same directory - which wasn''t the case in this example. Happy to provide more details when I have the code in front of me if you want.... On Mon, Jun 23, 2008 at 2:22 PM, Peter Bacon Darwin <bacondarwin at googlemail.com> wrote:> I think you''ll find that in the future, the IronRuby.Libraries assembly will > be merged into the IronRuby language assembly and so will not need to be > referenced. > By the way, can you get your program to work without referencing the > assembly in the project but by just copying the assembly into the folder > containing your executable? > Pete > > -----Original Message----- > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ben Hall > Sent: Monday,23 June 23, 2008 02:44 > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Improved error handling if IronRuby.Libraries is > not referenced > > Hi, > > This might sound like an odd request, but it has just caught me out. > Basically, I wanted to host IronRuby within a Console Application (for > a demo), however I didn''t reference IronRuby.Libraries, as a result I > was getting the exception - System.MissingMethodException was > unhandled Message="1::+ (the code was "puts 1+1"). > > This was my thought process: > 1) Created a new project. Reference DLR assemblies. > 2) Create new Runtime and Engine (using rb). Exception - missing > IronRuby reference. Forgot, lets reference that. > 3) Execute, method missing exception thrown. > 4) Confused. Looked back at my IronEditor code - realised I was > missing IronRuby.Librarires. > 5) Added reference - everything worked. > > Maybe it''s not required, but is there any way of better error handling > in this situation? > > Thanks > Ben > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core >
Curt Hagenlocher
2008-Jun-23 13:56 UTC
[Ironruby-core] Improved error handling if IronRuby.Libraries is not referenced
Sounds like something that belongs in the bug tracker... :). Someone seems to run into this issue every few weeks for Python as well, so there''s definitely a compelling story for making a change. -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ben Hall Sent: Sunday, June 22, 2008 6:44 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Improved error handling if IronRuby.Libraries is not referenced Hi, This might sound like an odd request, but it has just caught me out. Basically, I wanted to host IronRuby within a Console Application (for a demo), however I didn''t reference IronRuby.Libraries, as a result I was getting the exception - System.MissingMethodException was unhandled Message="1::+ (the code was "puts 1+1"). This was my thought process: 1) Created a new project. Reference DLR assemblies. 2) Create new Runtime and Engine (using rb). Exception - missing IronRuby reference. Forgot, lets reference that. 3) Execute, method missing exception thrown. 4) Confused. Looked back at my IronEditor code - realised I was missing IronRuby.Librarires. 5) Added reference - everything worked. Maybe it''s not required, but is there any way of better error handling in this situation? Thanks Ben _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core