question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] GraphML serialization fails with WriteDelegateCompiler error "Operation is not supported on this platform."

See original GitHub issue

Describe 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:

  1. Create any Unity project
  2. Import QuickGraph and QuikGraph.Serialization packages
  3. Write some code with GraphML serialization logic
  4. Attach script to some GameObject
  5. Build a Unity project in Release mode (File -> Build and Run)
  6. Run project in Release mode
  7. 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:closed
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
KeRNeLithcommented, Jul 19, 2021

Yep I will close this issue and make a mention in the QuikGraph wiki/documentation. Thanks for your feedback that has been instructive and will be helpful for others!

0reactions
Vasar007commented, Jul 19, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found