Configuration Validation in WCF 4.5


Today, in this article let's play around with one of the interesting and most useful concepts in WCF 4.5.

Question: What is configuration validation?

In simple terms "It provides warning messages to the user when an input string is not in the correct format in a XML file".

Step 1: The complete code of web.config looks like this:


<?xml version="1.0"?>





        <binding name="BasicHttpBinding_IService1"/>




      <endpoint address="http://localhost:4164/Service1.svc" binding="basicHttpBinding" contract="WCFApp.IService1" bindingConfiguration="BasicHttpBinding_IService1" name="BasicHttpBinding_IService1"/>




    <compilation debug="true"/>



Step 2:
The output of configuration validation error looks like this:


I hope this article is useful for you.