Parser error using masterpages - IIS is looking for a web.config file in the wrong place

Posted on 2007-07-19
Last Modified: 2013-11-07
Hi Experts,

I have a masterpage and a directory structure like this:


The opening default.aspx page works fine, but then if I click on the menu to go to deployments/manage.aspx, I get the following error:

Server Error in '/Blah_v1.2' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details beow and modify your configuration file appropriately.

Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to 'F:\visual STudio 2005\WebSites\Blah_v1.2\deployments' because the network BIOS command limit has been reached. For more information on this error, please refer to Microsoft knowledge base article 810886. Hosting on a UNC share is not supported for the Windows XP Platform.

Source ERror:
[No relevant source lines]

Source File: F:\Visual Studio 2005\Webites\Blah_v1.2\deployments\web.config    Line:0

So why is it looking for a web.config file in the deployments directory when there is already one at root level?

Do I  have to put my masterpage in its own masterpage directory? Is that what a "secured directory" means?

Question by:rss2
    LVL 9

    Expert Comment

    I'm not sure about the error, but I'd suggest moving the site to a local drive or a test server.

    As for master pages, you can reference them using the tilde character (~) which represents the root of the application, so your reference in the manage.aspx can be MasterPageFile="~/MasterPage.master"
    LVL 12

    Expert Comment

    I use a single masterpage with web.config files in the subdirectories and one at the root level.  
    Do you have a web.config file in the deployments directory?  Does your root level config have any <location> elements?

    Author Comment

    CmdoProg2, can you tell me a little more about that.. I thought each website app or whatever is supposed to have one web.config file. I don't have a web.config file for each directory..just the one at the root level.

    What happens is, when I get the error above, I just keep refreshing until I get the page. It eventually comes back. What's that all about?

    What should the web.config file look like for each directory?

    LVL 9

    Expert Comment

    Sorry to butt in, but you don't need a web.config file for each directory.  You can have one, if you want to change settings for that directory and all directories below it.  Otherwise, the directory will inherit the configuration from the web.config at the root level.
    LVL 12

    Expert Comment

    HappyFunBall is correct that you don't need a web.config file for each directory.  Generally, the subdirectory web.config file is used for page authorization.  It depends upon your needs, but I think your error is neither a masterpage or subdirectory web.config file problem since your page "eventually comes back".  Is your F drive a shared drive?

    BTW ... here is an sample subdirectory web.config file.  In the root web.config file, the directory authorization allows anonymous users.  This allows only authenicated users to access the MyAccount page.

    <?xml version="1.0" encoding="utf-8"?>
    <configuration xmlns="">
      <location path="MyAccount.aspx">
            <deny users="?" />

    Author Comment

    Cool I'm going to try that.

    Here is my web.config file that I have a root level. Is there anything wrong here? Like, do I need to specify the SQL Server 2005 provider somewhere? Is my provider wrong? Is the xml statement on the first line incorrect?

    <?xml version="1.0"?>
        Note: As an alternative to hand editing this file you can use the
        web admin tool to configure settings for your application. Use
        the Website->Asp.Net Configuration option in Visual Studio.
        A full list of settings and comments can be found in
        machine.config.comments usually located in
    <configuration xmlns="">
    <!--            <add name="OMDB" connectionString="Data Source=PLATMANDB,10501;Initial Catalog=WintelCFG;Integrated Security=SSPI" providerName="System.Data.SqlClient"/> -->
        <add name="OMDB" connectionString="Data Source=LDNDCM05673V05C\lf3_main3_dev;Initial Catalog=OMDB;Integrated Security=SSPI" providerName="System.Data.SqlClient"/>
                <add name="OMDBConnectionString" connectionString="Data Source=ldndcm05673v05c\lf3_main3_dev;Initial Catalog=OMDB;Integrated Security=True" providerName="System.Data.SqlClient"/>
        <add name="SMSWebReport" connectionString="http://ldnpsm00012cs/SMSReports/Report.asp?ReportID=133;" />
        <add name="DEMO" connectionString="ON;" />
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.

                Visual Basic options:
                Set strict="true" to disallow all data type conversions
                where data loss can occur.
                Set explicit="true" to force declaration of all variables.
                      <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
                <compilation debug="true" strict="false" explicit="true">
                            <add assembly="System.DirectoryServices, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                            <add assembly="Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                            <add assembly="System.Management, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
                            <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
                            <add namespace="System"/>
                            <add namespace="System.Collections"/>
                            <add namespace="System.Collections.Specialized"/>
                            <add namespace="System.Configuration"/>
                            <add namespace="System.Text"/>
                            <add namespace="System.Text.RegularExpressions"/>
                            <add namespace="System.Web"/>
                            <add namespace="System.Web.Caching"/>
                            <add namespace="System.Web.SessionState"/>
                            <add namespace="System.Web.Security"/>
                            <add namespace="System.Web.Profile"/>
                            <add namespace="System.Web.UI"/>
                            <add namespace="System.Web.UI.WebControls"/>
                            <add namespace="System.Web.UI.WebControls.WebParts"/>
                            <add namespace="System.Web.UI.HtmlControls"/>
            <add namespace="Barcap.SCM.SCCM"/>
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
                <authentication mode="Windows"/>
                <identity impersonate="true"/>
                The <customErrors> section enables configuration
                of what to do if/when an unhandled error occurs
                during the execution of a request. Specifically,
                it enables developers to configure html error pages
                to be displayed in place of a error stack trace.
            <customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />

    Thank you!!

    Author Comment

    CmdoProg2, yes my F: drive is a shared drive.

    Also in the web.config file your provided for authorising MyAccount.aspx, what if I want to provide this for the whole Deployments directory and the pages underneath it. How do I do that?
    LVL 12

    Expert Comment

    You can put the location element at the bottom of your root web.config file before the configuration closing tag.  The path attribute can be either a directory or a page.   When you specify a directory, then all pages and subdirectories in the directory are affected.  This can be overridden.  For more information see the definition at  

    As for your error, I suggest you try HappyFunBall's advise and test your application on a local drive to eliminate a coding problem.

    Author Comment

    Hey I realised what the problem was.

    I built my web site in Visual Studio .NET, and I selected a folder on a network drive where I work. Now, this network drive is a shared folder and as it's a large company, it's a reeeeally long folder name.

    A colleague told me that he wasn't sure, but thought the refreshing business might point to the fact that the file folder name is so incredibly long that the Visual Studio "allowed" filename reaches it's limit with some of my subfolders and thinks it can't find the web.config.

    So I closed everything and started over, this time using my local drive C:\ and a folder in there.

    Now it all works fine. No more parse error! fantastic! phew.


    Author Comment

    How do I indicate my comment is the solution for people reading this?
    LVL 9

    Accepted Solution

    There should be an option when you type a comment.

    But hey, can you give me credit for the solution, since it ultimately turned out that you needed to put the files on your local drive, and that was what I said to do in my first comment?

    It's generally a good idea to do so.  I've had other problems (like code access security issues) when I don't have the development site local.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now