XmlSerialization and xsi:SchemaLocation (xsd.exe)(XmlSerialization 和 xsi:SchemaLocation (xsd.exe))
问题描述
我使用 xsd.exe 生成了一个用于读取/写入 GPX 文件的 C# 类.如何让生成的 XML 文件包含 xsi:schemaLocation 属性例如.
I used xsd.exe to generate a C# class for reading/writing GPX files. How do I get the resultant XML file to include the xsi:schemaLocation attribute eg.
我想要以下但 xsi:schemaLocation 总是丢失
I want the following but xsi:schemaLocation is always missing
推荐答案
将此添加到您生成的 C# 类中:
Add this to your generated C# class:
显然 xsd.exe
工具 不会生成 schemaLocation
属性.
Apparently the xsd.exe
tool does not generate the schemaLocation
attribute.
这篇关于XmlSerialization 和 xsi:SchemaLocation (xsd.exe)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!