WCF Error HTTP Error 500.19 - Internal Server Error

If you get a following error after publishing the WCF Service in IIS 7.

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid

You need to make sure the application pool of the web site running in IIS should run in .NET 4.0.

1. Open IIS

2. Select the application pool on the website that WCF is hosted.

3. Click on the "Advanced Settings" on the right side pane of IIS.

4. Change .NET Framework Version value to v4.0