[Python.NET] System.TypeInitializationException

Sandro Hardy sandrohardy at web.de
Thu Oct 23 20:20:27 CEST 2008


Hi,

the problem has flown away today. Maybe because of installing pygame 
today morning(it is the only thing i changed), but I don't think so. 
Probably it is typical Windows behaviour.

Regards,
Sandro

Sandro Hardy schrieb:
> Hi,
> 
> this Code:
> ---------------------------------------------------------
> def stateChanged():
>         print "sdf"
> 
> bb.WiimoteChanged += System.EventHandler(stateChanged);
> ---------------------------------------------------------
> 
> ist working in a cygwin xterm. (no python installed in cygwin)
> 
> 
> But ist gives me this error in a Windows shell:
> 
> Unhandled Exception: System.TypeInitializationException: The type 
> initializer fo
> r 'Python.Runtime.CodeGenerator' threw an exception. ---> 
> System.InvalidCastExce
> ption: Unable to cast object of type 'System.Reflection.Module' to type 
> 'System.
> Reflection.Emit.ModuleBuilder'.
>    at 
> System.Reflection.Emit.AssemblyBuilderData.GetInMemoryAssemblyModule()
>    at System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, 
> Assembly
> BuilderAccess access, String dir, Evidence evidence, PermissionSet 
> requiredPermi
> ssions, PermissionSet optionalPermissions, PermissionSet 
> refusedPermissions, Sta
> ckCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes)
>    at System.AppDomain.DefineDynamicAssembly(AssemblyName name, 
> AssemblyBuilderA
> ccess access)
>    at Python.Runtime.CodeGenerator..cctor()
>    --- End of inner exception stack trace ---
>    at Python.Runtime.DelegateManager.GetDispatcher(Type dtype)
>    at Python.Runtime.DelegateManager.GetDelegate(Type dtype, IntPtr 
> callable)
>    at Python.Runtime.DelegateObject.tp_new(IntPtr tp, IntPtr args, 
> IntPtr kw)
>    at e__NativeCall.Call_3(IntPtr , IntPtr , IntPtr , IntPtr )
>    at Python.Runtime.MetaType.tp_call(IntPtr tp, IntPtr args, IntPtr kw)
>    at Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv)
>    at Python.Runtime.PythonConsole.Main(String[] args)
> 
> Any hints?
> Regards,
> Sandro
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> http://mail.python.org/mailman/listinfo/pythondotnet
> 



More information about the PythonDotNet mailing list