Skip to content

InvalidOperationException inside MsgPack (Do not convert System.String MessagePackObject to System.Int64.) #204

Closed

Description

@cspwizard
Do not convert System.String MessagePackObject to System.Int64.    

at MsgPack.MessagePackObject.ThrowInvalidTypeAs[T](MessagePackObject instance)
   at MsgPack.MessagePackObject.AsInt64()
   at MsgPack.Serialization.DefaultSerializers.NativeDateTimeMessagePackSerializer.UnpackFromCore(Unpacker unpacker)
   at MsgPack.Serialization.MessagePackSerializer`1.UnpackFrom(Unpacker unpacker)
   at MsgPack.Serialization.MessagePackSerializer`1.Unpack(Stream stream)
   at MsgPack.Serialization.MessagePackSerializer`1.UnpackSingleObject(Byte[] buffer)
   at _HashSetSeralizationFailsAndWriteFails() in Test.cs:line 391

This issue occurs when I try to deserialize serialized string as DateTime. Here is a reproduce code:

var date = MessagePackSerializer.Get<DateTime>().UnpackSingleObject(MessagePackSerializer.Get<string>().PackSingleObject("test"))

I would expect to get standard SerializationException as MsgPack does whet I try to deserialize same serialized string as a HashSet<string> instance.

Activity

  1. yfakariya commented on Nov 29, 2016

    @yfakariya
    Member

    Thank you, you are right. It should be appropriate type and message.

  2. added
    enhancementRequires or request to feature enhancement
    bugDetected as bug
    and removed
    enhancementRequires or request to feature enhancement
    on Nov 29, 2016
  3. cspwizard commented on Nov 30, 2016

    @cspwizard
    Author

    Can you give an estimate on new version release date with this issue fix?

  4. yfakariya commented on Dec 4, 2016

    @yfakariya
    Member

    Unfortunately, I'm busy in this month, so it will be next year. Sorry.

  5. yfakariya commented on May 4, 2017

    @yfakariya
    Member

    Fixed in 6b25651

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDetected as bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions