WCFExtras - 元素bahavior具有无效的子元素'wsdlExtensions'?
问题描述:
<endpointBehaviors>
<behavior name="singleFileEndpointBehavior">
<wsdlExtensions singleFile="True" />
</behavior>
</endpointBehaviors>
“wsdlExtensions”在它下面有一条蓝线,表示出现了问题。WCFExtras - 元素bahavior具有无效的子元素'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>
包括用于智能感知新元素的架构文件架构
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
其中C
是complexType/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>
我想这是一个错误发生在Visual Studio中,而不是在运行时。正确? – 2011-04-06 08:29:50
@Rest Wing,其实这只是一个提示/警告。该项目仍在建设和运行。 – Sam 2011-04-06 23:12:02