问题描述
我有课
public class MyClass
{
[XmlAttribute("noNamespaceSchemaLocation",Namespace = XmlSchema.InstanceNamespace)]
public string xmlShemaFile = "schema0.xsd";
public string Property1 { get; set; }
public string Property2 { get; set; }
}
当我序列化我得到的类
<?xml version="1.0" encoding="utf-8"?>
<MyClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="schema0.xsd">
<Property1>Content</Property1>
</MyClass>
Fehler:Fehler beim Verarbeiten von 'XmlValidationNetFramework472.exe'。
- Schemaelement 'attribute' mit dem Namen 'noNamespaceSchemaLocation' im Namespace 'http://www.w3.org/2001/XMLSchema-instance'。 Der Zielnamespace einer lokalen oder globalen Attributsdeklaration darf nicht mit http://www.w3.org/2001/XMLSchema-instance übereinstimmen.
- Der Zielnamespace einer lokalen oder globalen Attributsdeklaration darf nicht mit http://www.w3.org/2001/XMLSchema-instance übereinstimmen。
translate.google.com:
错误:无法处理“XmlValidationNetFramework472.exe”。
- 命名空间“http://www.w3.org/2001/XMLSchema-instance”中名为“noNamespaceSchemaLocation”的方案元素“attribute”。局部或全局属性声明的目标命名空间不得与 http://www.w3.org/2001/XMLSchema-instance 匹配。
- 局部或全局属性声明的目标命名空间不得与 http://www.w3.org/2001/XMLSchema-instance 匹配。
当我删除命名空间或将其留空时,xsd.exe 可以工作,但不再找到该方案。
有什么想法可以让这一代人工作吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)