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

Deserialization throws stack empty exception #83

Closed
ricebus opened this issue Aug 24, 2017 · 5 comments
Closed

Deserialization throws stack empty exception #83

ricebus opened this issue Aug 24, 2017 · 5 comments
Assignees
Labels
investigate Further investigation required

Comments

@ricebus
Copy link

ricebus commented Aug 24, 2017

Hey, I've started using YAXLib to serialize/deserialize my classes.

I have an issue where the deserialization process throws a weird exception
{System.InvalidOperationException: Stack empty. at System.Collections.Generic.Stack`1.ThrowForEmptyStack() at System.Collections.Generic.Stack`1.Pop() at YAXLib.YAXSerializer.FinalizeNewSerializer(YAXSerializer serializer, Boolean importNamespaces, Boolean popFromSerializationStack) at YAXLib.YAXSerializer.DeserializeCollectionValue(Type colType, XElement xelemValue, XName memberAlias, YAXCollectionAttribute colAttrInstance) at YAXLib.YAXSerializer.DeserializeCollectionMember(Object o, MemberWrapper member, Type colType, String elemValue, XElement xelemValue) at YAXLib.YAXSerializer.RetreiveElementValue(Object o, MemberWrapper member, String elemValue, XElement xelemValue) at YAXLib.YAXSerializer.DeserializeBase(XElement baseElement) at YAXLib.YAXSerializer.Deserialize(String input) at Hermes.Hermes.XmlToNcp() in C:\Users\George\documents\visual studio 2017\Projects\Hermes\Hermes\Hermes.cs:line 119}
The funny thing is that if I run it through deserilization a second time, it works.
Here's the XML it's trying to deserialize: https://pastebin.com/nKyhAnDe (in readable mode)

EDIT: forgot to mention it only happens in large strings. this one is about 19k chars long.

Thanks in advance,
George

@sinairv
Copy link
Collaborator

sinairv commented Aug 25, 2017

Hi George. Could you also please send the code, or the entities with attributes you use to deserialize the content?

@ricebus
Copy link
Author

ricebus commented Aug 25, 2017

Base.zip

The entity is NCPPacket

@ricebus
Copy link
Author

ricebus commented Sep 1, 2017

any luck with this?

@axunonb
Copy link
Collaborator

axunonb commented Feb 28, 2021

Sorry @ricebus, this has been a long time ago.

We're about to revitalizing this project, now going through open issues.
At the moment, the C# files and XML sample you had supplied cannot be built. To much guessing about dependencies.
If you're still interested, would you please complete the sample project attached to this post, or close the issue, if not?

DeserializationEmptyStackException.zip

@axunonb axunonb added investigate Further investigation required and removed bug labels Feb 28, 2021
@axunonb axunonb self-assigned this Feb 28, 2021
@axunonb
Copy link
Collaborator

axunonb commented Mar 14, 2021

Closed due to lack of activity.

@axunonb axunonb closed this as completed Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Further investigation required
Projects
None yet
Development

No branches or pull requests

4 participants