[Ironruby-core] Accessing 32-bit native DLL:s when running IR on Vista64

Shri Borde Shri.Borde at microsoft.com
Mon Jul 13 14:30:04 EDT 2009

Its trivial to implement "launch32". Just use AppDomain.ExecuteAssembly (http://msdn.microsoft.com/en-us/library/system.appdomain.executeassembly.aspx) to launch ir.exe in the same process. Now the launch32.exe wrapper program needs to be compiled using /platform:x86. The bitness of the process will be determined by the bitness of launch32.exe, not any exes it launches in-process using ExecuteAssembly.

That said, it *will* be useful to include platform-specific versions of ir.exe in the release. F# does this, and IronPython has recently started doing this. The main reason to do this is that startup is very slow on 64-bit machines. See http://stackoverflow.com/questions/1015076/why-is-ironpython-startup-time-so-slow. So having ir.exe be a 32-bit executable prevents people from naively hitting the slow startup, while including ir64.exe still enables the folks who need 64-bit processes (mainly because they are manipulating large data sets and need more than 2^32 address space)


-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Brotherus
Sent: Monday, July 13, 2009 3:02 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Accessing 32-bit native DLL:s when running IR on Vista64

We are building IronRuby top-layer on a legacy application that consist,
in part, of Windows 32-bit native dll:s. These native DLL:s are accessed
by C# code via P/Invoke and our IronRuby code subsequently calls the C#

We start our app by running: ie.exe main.rb

Things are going fine on Windows XP/Vista 32-bit. On 64-bit Vista, the
native DLL:s fail to load and application execution fails. This is
because 64-bit Vista uses by default 64-bit version of MS.NET framework
(in c:\Windows\Microsoft.NET\Framework64). This executes in a 64-bit
process that cannot load 32-bit dll:s. 

Vista64 has also 32-bit version of ms.net (in
c:\Windows\Microsoft.NET\Framework). When our app is run with this
version of the framework, it executes fine (loading 32-bit native dll:s)
on Vista64. 

However, the only way we have found out to run a dotnet-exe with the
32-bit dotnet-framework on Vista64 is to compile the dotnet-exe with
having "Platfowm target"-setting to be "x86" instead of the default "Any
CPU". This means that currenlty we are forced to use our own compilation
of ir.exe instead of working with the out-of-the-box
ironruby-installations at http://www.ironruby.net/Download.

Is there a way to start a dotnet-exe that has been built with "Any CPU"
setting explicitly with 32-bit version of dotnet framework? Something
c:\work> launch32 ir.exe main.rb

If no, would it make sense for ir installation packages to contain
out-of-the-box three versions of the main exe: ie.exe (Any CPU),
ir32.exe and ir64.exe ?

Robert Brotherus
Napa Inc.

Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list