Failed to access IIS metabase

Topics: Web Client Software Factory, User Forum
Jun 12, 2007 at 3:11 AM

I just installed the CTP June 2007 and created my first "Web Client Solution". I then ran the web site (default.aspx) and received an error: "Failed to access IIS metabase".

Here's the error page, any idea? The other web applications (non-websf) works.

Server Error in '/DevelopmentWebsite' Application.

Failed to access IIS metabase.
Description: 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.

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

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

HostingEnvironmentException: Failed to access IIS metabase.
System.Web.Configuration.ProcessHostConfigUtils.MapPathActual(IProcessHostSupportFunctions functions, String siteID, VirtualPath path) +465
System.Web.Configuration.ProcessHostMapPath.MapPathCaching(String siteID, VirtualPath path) +585
System.Web.Configuration.ProcessHostMapPath.GetPathConfigFilenameWorker(String siteID, VirtualPath path, String& directory, String& baseName) +13
System.Web.Configuration.ProcessHostMapPath.System.Web.Configuration.IConfigMapPath.GetPathConfigFilename(String siteID, String path, String& directory, String& baseName) +37
System.Web.Configuration.HostingPreferredMapPath.GetPathConfigFilename(String siteID, String path, String& directory, String& baseName) +77
System.Web.Configuration.WebConfigurationHost.GetStreamName(String configPath) +166
System.Configuration.Internal.DelegatingConfigHost.GetStreamName(String configPath) +10
System.Configuration.BaseConfigurationRecord.InitConfigFromFile() +253

[ConfigurationErrorsException: An error occurred loading a configuration file: Failed to access IIS metabase.]
System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) +247103
System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) +40
System.Configuration.Configuration..ctor(String locationSubPath, Type typeConfigHost, Object[] hostInitConfigurationParams) +412
System.Configuration.Internal.InternalConfigConfigurationFactory.System.Configuration.Internal.IInternalConfigConfigurationFactory.Create(Type typeConfigHost, Object[] hostInitConfigurationParams) +29
System.Web.Configuration.WebConfigurationHost.OpenConfiguration(WebLevel webLevel, ConfigurationFileMap fileMap, VirtualPath path, String site, String locationSubPath, String server, String userName, String password, IntPtr tokenHandle) +961
System.Web.Configuration.WebConfigurationManager.OpenWebConfigurationImpl(WebLevel webLevel, ConfigurationFileMap fileMap, String path, String site, String locationSubPath, String server, String userName, String password, IntPtr userToken) +84
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(String path) +36
Microsoft.Practices.CompositeWeb.Services.WebConfigModuleInfoStore.GetConfiguration(String configFilePath) +88
Microsoft.Practices.CompositeWeb.Services.WebConfigModuleInfoStore.PopulateSection(ModulesConfigurationSection section, String rootDirectory) +98
Microsoft.Practices.CompositeWeb.Services.WebConfigModuleInfoStore.GetModuleConfigurationSection() +35
Microsoft.Practices.CompositeWeb.Services.WebModuleEnumerator.EnumerateModules() +87
Microsoft.Practices.CompositeWeb.WebClientApplication.LoadModules() +125
Microsoft.Practices.CompositeWeb.WebClientApplication.Application_Start(Object sender, EventArgs e) +98

Jun 15, 2007 at 3:35 AM
Here's a bit more details:

The problem occurs at startup (as you have guessed in the stack trace).

It bombs on the following line:
WebConfigModuleInfoStore.cs/GetConfiguration(string configFilePath)

configuration = WebConfigurationManager.OpenWebConfiguration(context.Request.ApplicationPath + "/" + configFilePath.Replace(context.Request.PhysicalApplicationPath, ""));

My trace shows a "good" path:

context.Request.ApplicationPath + "/" + configFilePath.Replace(context.Request.PhysicalApplicationPath, "") = "/DevelopmentWebsite/web.config"

I'm running Vista at home, I'm an admin of my computer, and using the "May 2007" version of the WebSF and the app (VS) is executing under the standalone IIS ASP.Net Development Server.

I ran the Process Monitor and found no errors. I can see that the WebDev.WebServer.Exe opens the following:
- web.config,
- machine.config,
- .net framework web.config,
- registry (HKLM\System\CurrentControlSet\Services\Eventlog\...)

Any help, of course, would help.

BTW: I can run "normal" applications.
Jun 15, 2007 at 3:57 AM
Crap.... I now works, and I'm not sure what made it work.

- Web Project properties -> Start Options -> Server Change to Custom Server
- Uninstall IIS features
- Reinstall IIS features (make sure to include the Web Management Tools)
- Switch the - Web Project properties -> Start Options -> Server back to Default Web Server.

I'm not sure which made it work. Like I said, other apps worked... Puzzled....

A well, it works..

Jun 16, 2007 at 2:06 AM
Crap again............

I rebooted and the error page came back. grrrrr.

Metaacl.vbs gives me a "-2147221020"

My "normal" ASP.Net web apps work
My "WebSF" ASP.Net web apps don't work

I'm in the administrators group.
I'm running Vista.
I'm using the VS WebServer

Any clue? anyone?

Jun 16, 2007 at 2:11 AM
RUN AS Administrator !!!!!!!!!!!!!!!!!!!!
Jun 16, 2007 at 10:52 PM
Edited Jun 16, 2007 at 10:53 PM
Or as a developer, turn off UAC!