2011-04-06 90 views
7
<endpointBehaviors> 
    <behavior name="singleFileEndpointBehavior"> 
    <wsdlExtensions singleFile="True" /> 
    </behavior> 
</endpointBehaviors> 

“wsdlExtensions”在它下面有一条蓝线,表示出现了问题。WCFExtras - 元素bahavior具有无效的子元素'wsdlExtensions'?

The element 'behavior' has invalid child element 'wsdlExtensions' ...

有谁知道如何解决这一问题?

+0

我想这是一个错误发生在Visual Studio中,而不是在运行时。正确? – 2011-04-06 08:29:50

+0

@Rest Wing,其实这只是一个提示/警告。该项目仍在建设和运行。 – Sam 2011-04-06 23:12:02

回答

7

定义行为扩展元素wsdlExtensions的模式。

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

包括用于智能感知新元素的架构文件架构

Visual Studio中通常采用%VS_INSTALL_DIR%\xml\Schemas\DotNetConfig.xsd文件智能感知,除非在Visual Studio配置为使用其他一些文件。

要检查哪些文件用于Intellisense,请在配置文件处于打开状态时选择XML-> Schemas。 Intellisense中使用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> 
+0

令人印象深刻...我会给它一个去。 – Sam 2011-04-07 22:50:58

+1

感谢您的详细解答。 ''有另一个你错过的属性:''' – jpo 2013-11-14 13:56:42

相关问题