Starting with .net 11 preview 7 I get this error
System.NotSupportedException: Unable to retrieve stack trace information when StackTraceSupport feature switch is set to false.
at System.Reflection.Assembly.GetCallingAssembly()
at System.Reflection.Emit.AssemblyBuilder.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access)
at Python.Runtime.ReflectionPolyfills.DefineDynamicAssembly(AppDomain _, AssemblyName assemblyName, AssemblyBuilderAccess assemblyBuilderAccess)
at Python.Runtime.CodeGenerator..ctor()
at Python.Runtime.DelegateManager..ctor()
at Python.Runtime.PythonEngine.Initialize(IEnumerable`1 args, Boolean setSysArgv, Boolean initSigs)
at Python.Runtime.PythonEngine.Initialize(Boolean setSysArgv, Boolean initSigs)
at Python.Runtime.PythonEngine.Initialize()
The root cause seems to be this breaking change
dotnet/docs#54566
And the overloads used for AssemblyBuilder.DefineDynamicAssembly
https://github.com/dotnet/dotnet/blob/main/src/runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs#L24
I would think that using some other overload passing an assembly name explicitly or fallback, should do the work.
Starting with .net 11 preview 7 I get this error
The root cause seems to be this breaking change
dotnet/docs#54566
And the overloads used for AssemblyBuilder.DefineDynamicAssembly
https://github.com/dotnet/dotnet/blob/main/src/runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs#L24
I would think that using some other overload passing an assembly name explicitly or fallback, should do the work.