After installing IIS server when you browsing Asp.net web site or an asp.net aspx page in IIS server then you may getting or encounter an error named “Failed to access IIS metabase“.
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
you may have installed IIS Server after installing the .NET framework.
Error Screen shot:
This Error Caused Because You does not Register ASP.Net with IIS. Please Follow the below Steps to Regiser ASP.Net With IIS:
Step 1: Go to Start then Run
Step 2: Write cmd and then press enter
Step 3: Go to your windows directory. Here i am considering c Drive
Step 4: Type C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i
Step 6: Change the path based on your local path.
Step 7: Wait a few moment until a message comes Successfully Register.
Note: If you multiple .net version like Asp.net 1.1,Asp.net 2.0 or Asp.net 3.5 then modify the above command accordingly & run.
Hope now your problem has been resolved.