You may receive this error when you try to Host the WCF Service to IIS. Below is some more details about the error.
Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
Here is the sinple solution which I tried and it worked.
1- Go to the Visual Studio command prompt.
2- type below command and run it.
aspnet_regiis -ga DOMAIN\ASPNET
ASPNET is the default asp_net.exe process user. After running this you will receive message. Restart the IIS and refresh the page. The error should have been resolved.
Start granting SG-DT-033\ASPNET access to the IIS metabase and other directories
used by ASP.NET.
Finished granting SG-DT-033\ASPNET access to the IIS metabase and other director
ies used by ASP.NET.