[BUG] GraphML serialization fails with WriteDelegateCompiler error "Operation is not supported on this platform."
See original GitHub issueDescribe the bug
I used QuickGraph in oen of my Unity project. I have a GraphML serialization logic which perfectly works in Debug mode. However, when I run project in Release mode (see steps to reproduce), serialization always fails with stacktrace:
System.TypeInitializationException: The type initializer for 'WriteDelegateCompiler' threw an exception. ---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at QuikGraph.Serialization.GraphMLSerializer`3+WriteDelegateCompiler[TVertex,TEdge,TGraph].CreateWriteDelegate (System.Type nodeType, System.Type delegateType) [0x00042] in <9ecb0810e6744db493d1d934627823d5>:0
at QuikGraph.Serialization.GraphMLSerializer`3+WriteDelegateCompiler[TVertex,TEdge,TGraph]..cctor () [0x00000] in <9ecb0810e6744db493d1d934627823d5>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
at QuikGraph.Serialization.GraphMLSerializer`3+WriterWorker[TVertex,TEdge,TGraph].WriteGraphHeader () [0x000f3] in <9ecb0810e6744db493d1d934627823d5>:0
at QuikGraph.Serialization.GraphMLSerializer`3+WriterWorker[TVertex,TEdge,TGraph].Serialize () [0x00018] in <9ecb0810e6744db493d1d934627823d5>:0
at QuikGraph.Serialization.GraphMLSerializer`3[TVertex,TEdge,TGraph].Serialize (System.Xml.XmlWriter writer, TGraph graph, QuikGraph.VertexIdentity`1[TVertex] vertexIdentity, QuikGraph.EdgeIdentity`2[TVertex,TEdge] edgeIdentity) [0x00049] in <9ecb0810e6744db493d1d934627823d5>:0
at QuikGraph.Serialization.GraphMLExtensions.SerializeToGraphML[TVertex,TEdge,TGraph] (TGraph graph, System.Xml.XmlWriter writer, QuikGraph.VertexIdentity`1[TVertex] vertexIdentity, QuikGraph.EdgeIdentity`2[TVertex,TEdge] edgeIdentity) [0x00005] in <9ecb0810e6744db493d1d934627823d5>:0
at QuikGraph.Serialization.GraphMLExtensions.SerializeToGraphML[TVertex,TEdge,TGraph] (TGraph graph, System.Xml.XmlWriter writer) [0x0002b] in <9ecb0810e6744db493d1d934627823d5>:0
To Reproduce
Steps to reproduce the behavior:
- Create any Unity project
- Import
QuickGraphandQuikGraph.Serializationpackages - Write some code with GraphML serialization logic
- Attach script to some GameObject
- Build a Unity project in Release mode (File -> Build and Run)
- Run project in Release mode
- Serialization will fail
Expected behavior
Serialization will work. Also you can make a note in documentation instead that some platforms (which ones?) are not supported in the QuikGraph.Serialization package.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yep I will close this issue and make a mention in the
QuikGraphwiki/documentation. Thanks for your feedback that has been instructive and will be helpful for others!Okay, thanks! I think I can try to use XML serialization. I don’t have any requirenments because I just work on my own pet project 😃
So, you are free to close this issue. But I think note in the documentation could help for other users in the future.