You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there was a crash, please include the traceback here.
TypeError: FailedtocreatePython type formock.A
I modified the Pythonnet.dll to console error the C# exception and I get:
Python.Runtime.InternalPythonnetException: Failed to create Python type for mock.A---> System.TypeLoadException: VTable setup of type mock.Afailed
at (wrappermanaged-to-native) System.RuntimeType.GetMethodsByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,System.RuntimeType/MemberListType)
at System.RuntimeType.GetMethodsByName(System.Stringname,System.Reflection.BindingFlagsbindingAttr,System.RuntimeType+MemberListType listType,System.RuntimeTypereflectedType)[0x0001b]in<d636f104d58046fd9b195699bcb1a744>:0
at System.RuntimeType.GetMethodCandidates(System.Stringname,System.Reflection.BindingFlagsbindingAttr,System.Reflection.CallingConventionscallConv,System.Type[]types,System.Int32genericParamCount,System.BooleanallowPrefixLookup)[0x00010]in<d636f104d58046fd9b195699bcb1a744>:0
at System.RuntimeType.GetMembers(System.Reflection.BindingFlagsbindingAttr)[0x00000]in<d636f104d58046fd9b195699bcb1a744>:0
at Python.Runtime.ClassManager.GetClassInfo(System.Typetype,Python.Runtime.ClassBaseimpl)[0x00028]in<2aa3218182dd47ff892dddbce801f07b>:0
at Python.Runtime.ClassManager.InitClassBase(System.Typetype,Python.Runtime.ClassBaseimpl,Python.Runtime.ReflectedClrTypepyType)[0x00001]in<2aa3218182dd47ff892dddbce801f07b>:0
at Python.Runtime.ReflectedClrType.GetOrCreate(System.Typetype)[0x00047]in<2aa3218182dd47ff892dddbce801f07b>:0---End of inner exception stack trace ---atPython.Runtime.ReflectedClrType.GetOrCreate (System.Typetype)[0x00076]in<2aa3218182dd47ff892dddbce801f07b>:0at Python.Runtime.ReflectedClrType.CreateSubclass(Python.Runtime.ClassBasebaseClass,System.Collections.Generic.IList`1[T]interfaces,System.Stringname,System.Stringassembly,System.Stringns,Python.Runtime.BorrowedReferencedict)[0x0001f]in<2aa3218182dd47ff892dddbce801f07b>:0Traceback(mostrecent call last):
Environment
Details
I've stumbled upon an exception when creating a Type in Python from a C# interface that includes a generic return type (example code below)
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Converted to a DLL using:
csc /t:library IRobin.cs
Then bug validated with:
I modified the Pythonnet.dll to console error the C# exception and I get:
With a bit more console out I found the issue is when we try to get the members of the Python class: https://github.com/pythonnet/pythonnet/blob/v3.0.4/src/runtime/ClassManager.cs#L344
The text was updated successfully, but these errors were encountered: