We help IT Professionals succeed at work.

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

Medium Priority
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?

Watch Question

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"
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?


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?

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.
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="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <location path="MyAccount.aspx">
        <deny users="?" />


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="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<!--            <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!!


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?
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 http://msdn2.microsoft.com/en-us/library/b6x6shw7.aspx 

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


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.



How do I indicate my comment is the solution for people reading this?
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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.