Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessagePackDynamicObjectResolverException from IsolatedRuntime.Invoke #16

Open
khalidabuhakmeh opened this issue May 18, 2023 · 0 comments

Comments

@khalidabuhakmeh
Copy link

👋 Hello,

I'm trying to recreate the Minimal API sample from your recent YouTube video (great video btw), but I seem to get a MessagePack serialization issue with the latest version of DotNetIsolator (0.1.0-preview.10032). The error details are below.

I have the following environment:

  • macOS
  • .NET 8.0.100-preview.4.23260.5
  • DotNetIsolator 0.1.0-preview.10032
MessagePack.Internal.MessagePackDynamicObjectResolverException: can't find matched constructor. type:DotNetIsolator.IsolatedRuntime
         at MessagePack.Internal.ObjectSerializationInfo.CreateOrNull(Type type, Boolean forceStringKey, Boolean contractless, Boolean allowPrivate, Boolean dynamicMethod)
         at MessagePack.Internal.DynamicObjectTypeBuilder.BuildFormatterToDynamicMethod(Type type, Boolean forceStringKey, Boolean contractless, Boolean allowPrivate)
         at MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.FormatterCache`1..cctor()
      --- End of stack trace from previous location ---
         at MessagePack.FormatterResolverExtensions.Throw(TypeInitializationException ex)
         at Serialize(Byte[][], Object[], MessagePackWriter&, <>c__DisplayClass0_0, MessagePackSerializerOptions)
         at MessagePack.Internal.AnonymousSerializableFormatter`1.Serialize(MessagePackWriter& writer, T value, MessagePackSerializerOptions options)
         at MessagePack.Formatters.TypelessFormatter.Serialize(MessagePackWriter& writer, Object value, MessagePackSerializerOptions options)
         at MessagePack.MessagePackSerializer.Serialize[T](MessagePackWriter& writer, T value, MessagePackSerializerOptions options)
         --- End of inner exception stack trace ---
         at MessagePack.MessagePackSerializer.Serialize[T](MessagePackWriter& writer, T value, MessagePackSerializerOptions options)
         at MessagePack.MessagePackSerializer.Serialize[T](T value, MessagePackSerializerOptions options, CancellationToken cancellationToken)
         at MessagePack.MessagePackSerializer.Typeless.Serialize(Object obj, MessagePackSerializerOptions options, CancellationToken cancellationToken)
         at DotNetIsolator.IsolatedRuntime.CopyObject[T](T value)
         at DotNetIsolator.IsolatedRuntime.Invoke[TRes](Func`1 value)
         at Program.<>c__DisplayClass0_0.<<Main>$>b__0() in /Users/khalidabuhakmeh/RiderProjects/HelloWasi/WebApplication1/Program.cs:line 15
         at lambda_method1(Closure, Object, HttpContext)
         at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant