<endpointBehaviors> 
  <behavior name="singleFileEndpointBehavior"> 
    <wsdlExtensions singleFile="True" /> 
  </behavior> 
</endpointBehaviors> 

“wsdlExtensions”下方有一条蓝线,表示有问题。
The element 'behavior' has invalid child element 'wsdlExtensions' ...
有谁知道如何解决这一问题?

请您参考如下方法:

为行为扩展元素定义架构 wsdlExtensions .

<xs:complexType name="wsdlExtensions"> 
    <xs:attribute name="singleFile" type="boolean_Type" use="optional" default="True" /> 
</xs:complexType> 

在用于 Intellisense 的架构文件中包含新元素的架构

Visual Studio 通常使用 %VS_INSTALL_DIR%\xml\Schemas\DotNetConfig.xsd文件用于 Intellisense,除非 Visual Studio 配置为使用其他文件。

要检查哪些文件用于 Intellisense,请选择 XML->架构配置文件打开时。所有在 Use 中带有勾号的文件列用于智能感知。
<?xml version="1.0" encoding="us-ascii"?> 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense" 
           elementFormDefault="qualified" attributeFormDefault="unqualified" 
           vs:helpNamespace="http://schemas.microsoft.com/.NetConfiguration/v2.0"> 
    <!-- Child elements omitted for brevity --> 
</xs:schema> 

在模式文件中的适当级别定义新元素
wsdlExtensions的合适级别行为扩展元素是 system.serviceModel/C/behaviors/C/endpointBehaviors/C/behavior/C哪里 CcomplexType/choice元素。
<?xml version="1.0" encoding="us-ascii"?> 
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense" 
           elementFormDefault="qualified" attributeFormDefault="unqualified" 
           vs:helpNamespace="http://schemas.microsoft.com/.NetConfiguration/v2.0"> 
    <!-- Omitted elements at various levels for brevity --> 
    <xs:element name="system.serviceModel" vs:help="configuration/system.serviceModel"> 
        <xs:complexType> 
            <xs:choice minOccurs="0" maxOccurs="unbounded"> 
                <xs:element name="behaviors" vs:help="configuration/system.serviceModel/behaviors"> 
                    <xs:complexType> 
                        <xs:choice minOccurs="0" maxOccurs="unbounded"> 
                            <xs:element name="endpointBehaviors" vs:help="configuration/system.serviceModel/behaviors/endpointBehaviors"> 
                                <xs:complexType> 
                                    <xs:choice minOccurs="0" maxOccurs="unbounded"> 
                                        <xs:element name="behavior" vs:help="configuration/system.serviceModel/behaviors/endpointBehaviors/behavior"> 
                                            <xs:complexType> 
                                                <xs:choice minOccurs="0" maxOccurs="unbounded"> 
                                                    <xs:element name="wsdlExtensions" type="wsdlExtensions" /> 
                                                </xs:choice> 
                                            </xs:complexType> 
                                        </xs:element> 
                                    </xs:choice> 
                                </xs:complexType> 
                            </xs:element> 
                        </xs:choice> 
                    </xs:complexType> 
                </xs:element> 
            </xs:choice> 
        </xs:complexType> 
    </xs:element> 
</xs:schema> 


评论关闭
IT干货网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!