0

I have an application written in IronPython that I want to distribute as an .exe on other PCs. I've been using pyc.py following the instructions here, and been somewhat successful. I end up with a dir containing:

  • my_app.exe
  • my_app.dll
  • StdLib.DLL [this contains the standard IronPython library, as suggested in the SO post referenced above]
  • IronPython.dll
  • IronPython.Modules.dll
  • Microsoft.Dynamic.dll
  • Microsoft.Scripting.dll
  • Microsoft.Scripting.Metadata.dll

I'm using IronPython 2.7.3; on my dev machine I have .NET 4.0.30319.17929.

The problem I have is that when I distribute the above to other machines, on some machines it works perfectly, and on others I get the following:

Unhandled Exception: System.MissingMethodException: Method not found: 'Int32 Iro
nPython.Runtime.Operations.PythonOps.InitializeModuleEx(System.Reflection.Assemb
ly, System.String, System.String[], Boolean)'.
   at PythonMain.Main()

The machines it works on include both Windows 7 and Windows XP boxes, and the machines it fails on also include both Windows 7 and Windows XP. I've checked the .NET versions, comparing the machines where it works and where it doesn't work and I can't see anything obvious. For example, on an XP machine where it fails I have a .NET profile of:

<32Bit>
1.1.4322.2494
  ->C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
2.0.50727.3634
  ->C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
4.0.30319.269
  ->C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319

< Installed .NET Frameworks >
.NET FW 1.1 SP 1
.NET FW 2.0 SP 2
.NET FW 3.0 SP 2
.NET FW 3.5 SP 1
.NET FW 4.0 Client
.NET FW 4.0 Full

and on an XP machine where it works fine I have a .NET profile of:

<32Bit>
1.1.4322.2494
  ->C:\Windows\Microsoft.NET\Framework\v1.1.4322
2.0.50727.3634
  ->C:\Windows\Microsoft.NET\Framework\v2.0.50727
4.0.30319.269
  ->C:\Windows\Microsoft.NET\Framework\v4.0.30319

< Installed .NET Frameworks >
.NET FW 1.1 SP 1
.NET FW 2.0 SP 2
.NET FW 3.0 SP 2
.NET FW 3.5 SP 1
.NET FW 4.0 Client
.NET FW 4.0 Full

which looks identical to me.

I don't really know what to look at next; any clues?

Community
  • 1
  • 1
lemondifficult
  • 231
  • 3
  • 15
  • 1
    The first thing to look at is whether the failing machines have IronPython installed. There may be some mismatches between versions, since assemblies in the GAC override local ones. – Jeff Hardy Nov 07 '12 at 00:42
  • Thanks Jeff! That was the answer - seems obvious in hindsight, but I didn't realise about the GAC assemblies overriding the local ones, and I didn't remember installing IronPython on one of the machines where it was failing, must have done it months ago when I was messing about. – lemondifficult Nov 07 '12 at 10:54

1 Answers1

0

Jeff Hardy's comment above is the answer: the machines getting the error already had older versions of IronPython installed, and were using the those assemblies rather than the local ones distributed in the same dir as the exe. Solved by uninstalling IronPython on the problematic machines.

lemondifficult
  • 231
  • 3
  • 15