2011-04-06 40 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

相關問題