Error: The type arguments for method
GraphMLExtensions.SerializeToGraphML<TVertex,TEdge,TGraph>(TGraph,
cannot be inferred from the usage.
XmlWriter)
using System.Xml; using QuickGraph; using QuickGraph.Serialization; var g = new AdjacencyGraph<string,Edge<string>>(); .... add some vertices and edges .... using (var xwriter = XmlWriter.Create("somefile.xml")) g.SerializeToGraphML(xwriter);
代码是从QuickGraph的文档中复制的.但是,当我明确地写它时,它有效:
using (var xwriter = XmlWriter.Create("somefile.xml")) GraphMLExtensions.SerializeToGraphML<string,Edge<string>,AdjacencyGraph<string,Edge<string>>>(g,xwriter);
编辑:我看到了一些相关的问题,但它们对我来说太先进了.我只是担心使用它.我做错了什么还是文件?