Index: pythonnet/src/runtime/assemblymanager.cs =================================================================== --- pythonnet/src/runtime/assemblymanager.cs (révision 90) +++ pythonnet/src/runtime/assemblymanager.cs (copie de travail) @@ -87,7 +87,12 @@ static void AssemblyLoadHandler(Object ob, AssemblyLoadEventArgs args){ Assembly assembly = args.LoadedAssembly; assemblies.Add(assembly); - ScanAssembly(assembly); + // .NET v2.0 SP1 bug workaround ; ScanAssembly called on newly created DynamicAssembly causes problems + // only scan non-dynamic assemblies... + if ( !(assembly is System.Reflection.Emit.AssemblyBuilder) ) + { + ScanAssembly(assembly); + } }
hmmm ... I have SP1 for sure, but also .NET 3.5 - maybe that is the problem?
Von: Feihong Hsu [mailto:hsu.feihong@yahoo.com]
Gesendet: Di 30.09.2008 20:44
An: Craig Farrow; Dirk Krause
Cc: pythondotnet@python.org
Betreff: Re: AW: [Python.NET] error messages
Usually you can find a clue by looking in Control Panel > Add/Remove Programs. If you got SP1 or something like that, it'll be listed.
--- On Tue, 9/30/08, Dirk Krause <dirk.krause@pixelpark.com> wrote:
From: Dirk Krause <dirk.krause@pixelpark.com>
Subject: AW: [Python.NET] error messages
To: "Feihong Hsu" <hsu.feihong@yahoo.com>, "Craig Farrow" <craig_farrow@sil.org>
Cc: pythondotnet@python.org
Date: Tuesday, September 30, 2008, 12:35 PM
nah, doesnt work here:D:\projects\pyov>helloform.pyUnbehandelte Ausnahme: System.IO.FileLoadException: Die Datei oder Assembly Python.Runtime, Version=2.0.0.2, Culture=neu
tral, PublicKeyToken=64e14e845abf2e60 oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinitio
n der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
Dateiname: Python.Runtime, Version=2.0.0.2, Culture=neutral, PublicKeyToken=64e14e845abf2e60
bei Python.Runtime.PythonConsole.Main(String[] args)I probably have to compile it.Is there a way to find out which .NET version is installed?
Von: Feihong Hsu [mailto:hsu.feihong@yahoo.com]
Gesendet: Di 30.09.2008 18:56
An: Craig Farrow; Dirk Krause
Cc: pythondotnet@python.org
Betreff: Re: [Python.NET] error messages
This problem sounds familiar. Perhaps you guys are using .NET 2.0 with SP1 applied? Then this blog post of mine might help:
http://feihonghsu.blogspot.com/2008/02/pythonnet-20-for-net-sp1_15.html
If you want, you can try the binary that I made instead of applying the patch yourself.
--- On Tue, 9/30/08, Dirk Krause <dirk.krause@pixelpark.com> wrote:
From: Dirk Krause <dirk.krause@pixelpark.com>
Subject: Re: [Python.NET] error messages
To: "Craig Farrow" <craig_farrow@sil.org>
Cc: pythondotnet@python.org
Date: Tuesday, September 30, 2008, 8:50 AM
right you are again. splitter works here, too.Can you confirm that helloform runs when you disable line 33?# Register the event handler
# self.button.Click += self.button_Click
Von: Craig Farrow [mailto:craig_farrow@sil.org]
Gesendet: Di 30.09.2008 15:25
An: Dirk Krause
Cc: pythondotnet@python.org
Betreff: Re: AW: [Python.NET] error messagesAh, yes. On my system (Vista, Python 2.4 or 2.5, pythonnet-2.0-alpha2) only splitter.py works out of the three demos. I haven't tried to figure out why...
Craig.
9/30/2008 9:13 PM dï, Dirk Krause pišdimiš:much better! ...python itself runs now.but not really good either, trying to run helloform.py gives me:D:\projects\pyov>helloform.pyUnbehandelte Ausnahme: System.TypeInitializationException: Der Typeninitialisierer für Python.Runtime.CodeGenerator hat
eine Ausnahme verursacht. ---> System.InvalidCastException: Das Objekt des Typs System.Reflection.Module kann nicht in T
yp System.Reflection.Emit.ModuleBuilder umgewandelt werden.
bei System.Reflection.Emit.AssemblyBuilderData.GetInMemoryAssemblyModule()
bei System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evide
nce evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, St
ackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes)
bei System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access)
bei Python.Runtime.CodeGenerator..cctor()
--- Ende der internen Ausnahmestapelüberwachung ---
bei Python.Runtime.DelegateManager.GetDispatcher(Type dtype)
bei Python.Runtime.DelegateManager.GetDelegate(Type dtype, IntPtr callable)
bei Python.Runtime.EventObject.AddEventHandler(IntPtr target, IntPtr handler)
bei Python.Runtime.EventBinding.nb_inplace_add(IntPtr ob, IntPtr arg)
bei Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw)
bei Python.Runtime.MetaType.tp_call(IntPtr tp, IntPtr args, IntPtr kw)
bei Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv)
bei Python.Runtime.PythonConsole.Main(String[] args)
Von: Craig Farrow [mailto:craig_farrow@sil.org]
Gesendet: Di 30.09.2008 14:53
An: Dirk Krause
Cc: pythondotnet@python.org
Betreff: Re: [Python.NET] error messagesTry the UCS2 directory.
Craig.
9/30/2008 5:54 PM dï, Dirk Krause pišdimiš:Hi,I get the following error message when trying to run the python.exe from python2.5-UCS4 (I have a fully installed Python 2.5), any ideas? Vista professional here.... unfortunately in german:"""Unbehandelte Ausnahme: System.IO.FileLoadException: Die Datei oder Assembly Python.Runtime, Version=0.0.0.0, Culture=neu
tral, PublicKeyToken=null oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assemb
ly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)
Dateiname: Python.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
bei Python.Runtime.Runtime.PyUnicode_FromUnicode(String s, Int32 size)
bei Python.Runtime.Runtime.Initialize()
bei Python.Runtime.PythonEngine.Initialize()
bei Python.Runtime.PythonConsole.Main(String[] args)"""Thanks,Dirk
_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet_________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet