[Ironpython-users] Using pyc.py get import error on minimal WPF app

Chaim Krause chaim at chaim.com
Tue Jul 5 15:59:04 CEST 2011


Runs fine in IronPython IDE /Visual Studio 2010, but...

Using minimal code:

import wpf

from System.Windows import Application, Window

class MyWindow(Window):
     def __init__(self):
         wpf.LoadComponent(self, 'WpfApplication1.xaml')


if __name__ == '__main__':
     Application().Run(MyWindow())

Compiling using pyc.py and attempting to run resulting EXE I get an 
error in windows' application event log

Application: WpfApplication1.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: IronPython.Runtime.Exceptions.ImportException
Stack:
    at 
Microsoft.Scripting.Interpreter.Interpreter.Run(Microsoft.Scripting.Interpreter.InterpretedFrame)
    at Microsoft.Scripting.Interpreter.LightLambda.Run8[[System.__Canon, 
mscorlib, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089]](System.__Canon, System.__Canon, 
System.__Canon, System.__Canon, System.__Canon, System.__Canon, 
System.__Canon, Int32)
    at System.Dynamic.UpdateDelegates.UpdateAndExecute7[[System.__Canon, 
mscorlib, Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, 
Version=4.0.0.0, Culture=neutral, 
PublicKeyToken=b77a5c561934e089]](System.Runtime.CompilerServices.CallSite, 
System.__Canon, System.__Canon, System.__Canon, System.__Canon, 
System.__Canon, System.__Canon, Int32)
    at 
IronPython.Runtime.Importer.ImportLightThrow(IronPython.Runtime.CodeContext, 
System.String, IronPython.Runtime.PythonTuple, Int32)
    at 
IronPython.Runtime.Operations.PythonOps.InitializeModule(System.Reflection.Assembly, 
System.String, System.String[])
    at PythonMain.Main()



More information about the Ironpython-users mailing list