微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

xsd 文件内容 xml 未在 Chrome 浏览器中加载

如何解决xsd 文件内容 xml 未在 Chrome 浏览器中加载

我的项目中有一个 XSD 文件,我想使用文件流写入这个 XSD 文件内容,但它抛出错误,例如: ReadTimeout = 'fs.ReadTimeout' 引发了类型为“system.invalidOperationException”的异常 WriteTimeout = 'fs.WriteTimeout' 引发了类型为 'system.invalidOperationException' 的异常

XSD 文件内容

       <?xml version="1.0" encoding="utf-8"?>
       <xs:schema id="Resources" 
       targetNamespace="http://tempuri.org/SecurityZoneResources.xsd" 
       elementFormDefault="qualified" xmlns="http://tempuri.org/Resources.xsd" 
       xmlns:mstns="http://tempuri.org/Resources.xsd" 
       xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
       <xs:element name="Document">
       <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
            <xs:element name="Details">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="ID" type="xs:long" />
                        <xs:element name="DomainID" type="xs:long" />
                        <xs:element name="GroupID" type="xs:long" minOccurs="0" />
                        <xs:element name="Name" type="xs:string" minOccurs="0" />
                        <xs:element name="Owner" type="xs:string" minOccurs="0" />
                        <xs:element name="Description" type="xs:string" minOccurs="0" />
                        <xs:element name="Policy" type="xs:string" minOccurs="0" />
                        <xs:element name="IsDeleted" type="xs:boolean" />
                        <xs:element name="Created" type="xs:dateTime" />
                        <xs:element name="CreatedBy" type="xs:string" />
                        <xs:element name="Updated" type="xs:dateTime" minOccurs="0" />
                        <xs:element name="UpdatedBy" type="xs:string" minOccurs="0" />
                        
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            
        </xs:choice>
    </xs:complexType>
    <xs:unique name="DocumentKey1">
        <xs:selector xpath=".//mstns:Details" />
        <xs:field xpath="mstns:ID" />
    </xs:unique>
    <xs:unique name="Table1_Constraint1">
        <xs:selector xpath=".//mstns:SecurityZoneResources" />
        <xs:field xpath="mstns:ResourceID" />
    </xs:unique>
</xs:element>
</xs:schema>

文件

private FileStream getFileStream(string fileName)
{
    // read Schema
    FileStream fs = new FileStream(String.Format(@"{0}\{1}",Server.MapPath(@"..\Schemas"),fileName),FileMode.Open,FileAccess.Read);

    return fs;
}

这个 fs 抛出错误 ReadTimeout = 'fs.ReadTimeout' 引发了类型为“system.invalidOperationException”的异常 WriteTimeout = 'fs.WriteTimeout' 引发了类型为 'system.invalidOperationException' 的异常

如何解决?有人有任何线索吗?为什么我会收到 ReadTimeout 和 WriteTimeout 错误

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。