locked
Failed to access IIS metabase RRS feed

  • Question

  • Getting the following when am trying to run a web client in Visual Studio 05.

    I have already set the permissions using "aspnet_regiis -ga aspnet" for the web service I created and it works fine. Switch projects to the client and i get this. Switch back to the web service and it works.

    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.

     

    Any ideas??? 

    Wednesday, February 8, 2006 4:42 PM

Answers

  • Open Dot net Command prompt

     

    execute this command "aspnet_regiis -i"

     

    c:\Program Files\Microsoft Visual Studio 8\VC>aspnet_regiis -i
    Start installing ASP.NET (2.0.50727).
    .........................................
    Finished installing ASP.NET (2.0.50727).

     

    Friday, October 19, 2007 8:35 AM
  • the way to refresh your asp.net2.0 installation is:
        on Win2k3 OS:    aspnet_regiis -i -enable
        on other OS:        aspnet_regiis -i
    Thursday, June 26, 2008 11:59 PM
    Moderator

All replies

  • Hi,

    Could you please post the stack trace for the exception that you see?  It would be useful to know where the exception is getting thrown.

    It sounds like you have created a web service that is hosted on IIS.  When you say "it works fine" do you mean that you can browse to the service using IE or hit F5 from the service project and see the service in IE?

    I'm not sure I understand exactly what you mean by a "web client."  Have you created a separate application project that has a generated proxy type for communicating with the service?  Did you generate this proxy type using wsdl.exe or the Add Web Reference dialog?

    Thanks for you patience.

    Daniel Roth

    Wednesday, February 8, 2006 6:37 PM
  • Hi Daniel,

    I am running the following basic code for ASP.NET website project. Just a button and a label

    using System;

    using System.Data;

    using System.Configuration;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Web.UI.HtmlControls;

    public partial class _Default : System.Web.UI.Page

    {

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void Button1_Click(object sender, EventArgs e)

    {

    Label1.Text = "Lets see if this works";

    }

    }

    When I run this from Debug->Start Without Debugging - I get the following error

     Server Error in '/WebSiteTest' 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 http://support.microsoft.com/?kbid=267904.

    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.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3492154
       System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
       System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
       System.Web.CachedPathData.GetConfigPathData(String configPath) +382
       System.Web.CachedPathData.GetConfigPathData(String configPath) +243
       System.Web.CachedPathData.GetApplicationPathData() +68
       System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3385663
       System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

     

    I saw a simiar error when I was implementing a very basic ASP.NET Web Service. To solve this I ran "aspnet_regiis -ga ASPNET" and the web service ran through the same Debug->Run without debugging. When I do the same for the website project I still get the same error.

    Appreciate any suggestions.

    Regards,

     

    Brian

    Thursday, February 9, 2006 9:20 AM
  • Hi.

    Had a similar problem and, following this thread, discovered that the culprit was re-installing IIS after installing .NET Framework 2.0.

    If this applies to you, you can fix the problem via Control Panel > Add/Remove Programs > Add/Remove .NET Framework 2.0 > Repair .Net Framework 2.0 (no need to reboot in my case).

    There are some other suggestions in that thread but none applied to me so I can't vouch for them. I suggest you try the above first as it appears to be the most straightforward of the solutions offered.

    --
    Hope that helps.
    Mark
    Monday, February 13, 2006 4:10 PM
  • Perfect! Ran into the same problem, did a repair on .NET 2.0 framework and now the app's working gr8.
    Thanks for the input!
    Tuesday, February 28, 2006 7:09 PM
  • I am having the same problem "Failed to access IIS metabase".  I tried the repair tool for .Net 2.0 Framework, but it did not work.  I tried uninstalling the whole fremework amd downloaded and installed a fresh copy form the micrsoft website and I still get the same error.

    If there are any other solutions can anyone let me know
    Friday, March 24, 2006 5:10 AM
  • The only that work for me, was:

    Go to IIS Admin
    Rigth Click on Default Web Site
    Go to Operator Tab
    Add the ASPNET user on the list

    Works Fine!

    Wednesday, April 19, 2006 3:42 PM
  • Thank you, this last fix worked wonderfully for me.  Quick and simple.
    Tuesday, June 27, 2006 2:32 PM
  • Saturday, July 8, 2006 8:22 PM
  • The above tweak worked for me too on windows 2000 server.

    Would be interested to know any side affects of doing the above..as earlier only administrators are the only group specified as operators.

    Friday, July 21, 2006 4:08 AM
  • Which version of IIS Admin are you using?

    Strangely enough I do not have this 'Operator' Tab.

    Wednesday, September 27, 2006 1:57 AM
  • USE aspnet_regiis -i

    DETAILS:

    If you're like me and have both ASP.NET 1.1 and 2.0 on your machine (along with the associated Visual Studio 2003 and 2005 products because you can't help but write software in both environments) you may encounter this issue.  Upon running your website (via http://localhost/xxx or something like that), you may encounter the error page that reports:

    Failed to access IIS metabase

    If so, you may have installed IIS after installing the .NET framework.  If that's the case, try running to repair your ASP.NET installation and set up all of the appropriate ISAPI extension mappings.

    aspnet_regiis -i

    If, however, you're like me and had IIS already installed, and you installed VS 2003 and then VS 2005, and then set up a 1.1 virtual directory / website, simply check that the appropriate ASP.NET version is associated with it (Select VDIR --> Properties --> ASP.NET tab).

    "aspnet_regiis -i" once again was successful! However, the directory it is located in was not included a system path previously, so just note that you may have to run this from the "WINDOWS\Microsoft.NET\Framework\vX.X.XXXXX" directory (with the X's being your version number)

     

    César Augusto

    Friday, November 3, 2006 2:45 PM
  • I fit the description for this thread very nicely, except there isn't an Operators tab in IIS 5.1 on Windows XP Pro.

    So there's no way to make the ASPNET account an "operator".

    Already spent over a day on this.

    Hint: Adding ASPNET to the Adminsitrators group "works", but I'd rather not make this a permanent solution.

    Unfortunately "Failed to access IIS metabase" doesn't say exactly what resource had the problem (metabase.bin, or some folder associated with the metabase).

    Saturday, November 18, 2006 4:37 PM
  • Hi Mark,

    Thanks a lot.Ur suggestion was valuable. It worked.I repaired the .net framework 2.0 and restarted the machine.It was working fine.

    Thank you

    Thursday, March 15, 2007 6:54 PM
  • I used your idea and it worked... thanks a lot!!!
    Wednesday, March 28, 2007 8:09 PM
  • hi

    having same problem

    Tried lots of way but this works gr8.!!thanx a lot

     

     

    Saturday, July 7, 2007 9:27 AM
  • Open Dot net Command prompt

     

    execute this command "aspnet_regiis -i"

     

    c:\Program Files\Microsoft Visual Studio 8\VC>aspnet_regiis -i
    Start installing ASP.NET (2.0.50727).
    .........................................
    Finished installing ASP.NET (2.0.50727).

     

    Friday, October 19, 2007 8:35 AM
  • Hi Mark,

     

    Thks a lot for ur idea. I solved it this problem. That's gr8.

     

    Cheers,

    Annpi

     

     Mark J. wrote:
    Hi.

    Had a similar problem and, following this thread, discovered that the culprit was re-installing IIS after installing .NET Framework 2.0.

    If this applies to you, you can fix the problem via Control Panel > Add/Remove Programs > Add/Remove .NET Framework 2.0 > Repair .Net Framework 2.0 (no need to reboot in my case).

    There are some other suggestions in that thread but none applied to me so I can't vouch for them. I suggest you try the above first as it appears to be the most straightforward of the solutions offered.

    --
    Hope that helps.
    Mark

    Tuesday, May 27, 2008 4:19 AM
  • the way to refresh your asp.net2.0 installation is:
        on Win2k3 OS:    aspnet_regiis -i -enable
        on other OS:        aspnet_regiis -i
    Thursday, June 26, 2008 11:59 PM
    Moderator
  • is the IIS Admin same as what's on the Control Panel > Administrative Tools > Internet Information Services??? thanks
    Tuesday, July 29, 2008 2:14 AM
  • Hi All,

    This is the solution for this Problem.

    The aspnet_regiis.exe is in two places:

    - <C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>
    and
    - <C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>

    1)
    If you are running VS 2008, make sure to run the cmd from:
    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

    and you will see

    Start installing ASP.NET (2.0.50727).
    .........................................
    Finished installing ASP.NET (2.0.50727).

    2)
    If you added the path of aspnet_regiis.exe  in Environment Variables, make sur that the
    path of aspnet_regiis.exe  is : C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727


    Et Voila!

    Cheers,

    J


    Jawad
    Thursday, January 14, 2010 1:52 AM