Failed to access IIS metabase.

What is the problem

The error message tells you :

[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)


how can I fix it?


Since you're using ASP.NET 2.0, all you have to do is run :

aspnet_regiis -ga WindowsUserAccount
( from a command line in the .Net framework 2.0.50727 directory )

Also, if you attempted impersonation in web.config, remove the entry.
That will make the user default back to whichever default account ASP.NET uses in your OS.

If you're using XP, the account is "ASPNET".
If you're using Server 2003, the account is "Network Service".
If you're using Vista, the account is "Network Service ".

You can also attempt to unregister and then re-register the default account ASP.NET uses.

To do that, first run :

aspnet_regiis -u

and then run :

aspnet_regiis -i

The first command will unregister ASP.NET from IIS, deleting the current user acount,
and the second one will re-register ASP.NET with IIS, recreating the default account.

BUT, you *must* undo any changes you made, if you made any
in the web.config, if you had attempted to use impersonation.

i.e., instead of using :

<identity impersonate="true" userName="YourAccount" password="YourStrongPassword" />

Just use :

<identity impersonate="false" />

....or delete the "identity impersonate" web.config entry.

Comments

Popular posts from this blog

ContextSwitchDeadlock was detected

Visual Studio setup and deployment projects

Using SvcUtil.exe to generate the proxy class and config file