System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
This issue occurs if you are installing IIS Server after .NET framework got installed in the system.
In my scenario, I have installed Visual Studio in the following steps.
- Refreshed Windows XP with SP3
- Installed Visual Studio 2008
- Installed VS SP1
- Installed TFS
- Installed SQL Server 2008
- Installed IIS Server
- Open the Web application and ran it, I got the error mentioned above.
After some Google search, I found the following sequence of steps to resolve the issue. I got success it in.
1. Open the Add and Remove Programs from Control Panel. (To open Go to Start -> Control Panel -> Add and Remove Programs)
2. There will be Microsoft .NET Framework installed in your system.
If you install Visual Studio 2005, you can see Microsoft .NET Framework 2.0.
If you install Visual Studio 2008, you can see Microsoft .NET Framework 2.0, 3.0, 3.5 in your system.
(Verify the following image which has been installed in my system after installed the above steps mentioned)
3. Select the Microsoft .NET Framework version and Click the Change/Remove or Change button.
If you installed Visual Studio 2005 (.NET 2.0), you need to select Microsoft Framework 2.0 version and click the Change button.
If you installed Visual Studio 2008 (.NET 3.5), you need to select Microsoft Framework 3.5 version and click the Change/Remove button. (Even you are developing the application with .NET 2.0, you required to repair .NET 3.5)
4. Select the Repair button.
5. The system will prompt you to reboot the system after the completion of Repair process.
6. After restart, you can run the ASP.NET application. If should work fine, otherwise raise it as an issue in the asp.net forums to get clarify the issue.