I have the following, rather irritating, warning appearing my visual studio error list:
The element 'behavior' has invalid child element 'silverlightFaults'. List of possible elements expected: 'clientVia, callbackDebug, callbackTimeouts, clear, clientCredentials, transactedBatching, dataContractSerializer, dispatcherSynchronization, remove, synchronousReceive, enableWebScript, webHttp, endpointDiscovery, soapProcessing'.
It originates from web.config. The application compiles fine, I just want to suppress the error.
What doesn't work:
Any way to hide this warning, or do I have to live with it?
Solution found. You can update the schema file VS validates again to get rid of the warning. It will only work for your local pc, but if you're anal-retentive about warnings like myself it's worth it.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas\DotNetConfig.xsd
Click the link to open the XML Schema Explorer
Find the node system.serviceModel\behaviors\endpointBehaviors\behavior and double click it.
This will take you to the offending area in the schema file, which begins with:
<xs:element name="behavior" vs:help="configuration/system.serviceModel/behaviors/endpointBehaviors/behavior">
Two lines below that, you will see:
<xs:choice minOccurs="0" maxOccurs="unbounded">
Inside that node is where you want to add the offending element. In my case, I added the following:
<xs:element name="silverlightFaults">
</xs:element>
Of course, make sure you make a backup of the file before doing this in case anything goes wrong.