XML模式定义工具未生成SchemaLocation [英] XML Schema Definition Tool not generating SchemaLocation
问题描述
从普通的旧C#对象生成XSD时,Visual Studio附带的xsd.exe工具是否生成SchemaLocation属性(在xs:import中)?
Does the xsd.exe tool provided with Visual Studio generate the SchemaLocation attribute (in the xs:import) when generating XSDs from plain old C# objects?
我发现生成的XSD无效,因为xs:import将导入名称空间,并且不提供提示以下内容的相对schemalocation值
I am finding that my XSDs that were generated are not valid because the xs:import will import a namespace and not provide the relative schemalocation value prompting the below
名称空间'urn:company-event-namespace'的导入架构未解决.
Imported Schema for namespace 'urn:company-event-namespace' was not resolved.
推荐答案
如您所见,它不会生成该属性.这可能与以下事实有关:如果该属性存在于正在读取的架构中,则该属性将不使用该属性.
As you've found, it does not generate that attribute. This may have to do with the fact that it would not use that attribute if the attribute were present in a schema it was reading.
这篇关于XML模式定义工具未生成SchemaLocation的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!