ASP.NET runtime error: The master file cannot be processed because the code directory has not yet been built RRS feed

  • Question

  • User280478734 posted

    Hi All,

    I am using Visual Studio 2010 Ultimate version and am seeing the above warning in all my .aspx files. The code runs just fine, no issues at all. 

    It just seems to be not recognized/compiled by VStudio.  Please find attached the directory structure and my entire web.config file. My master file does reference UserControls, but I removed them to test and the issue remains. I have also tried closing all files, building, rebuilding, restarting VStudio in all orders possible and multiple times.

    Please advise. Thanks!

    <?xml version="1.0" encoding="utf-8"?>
        <directoryBrowse enabled="false" />
            <remove name="FormsAuthenticationModule" />
            <add name="FormsAuthenticationModule" type="System.Web.Security.FormsAuthenticationModule" />
            <remove name="UrlAuthorization" />
            <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
            <remove name="DefaultAuthentication" />
            <add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" />
                <remove name="X-Powered-By" />
        <httpRuntime enableVersionHeader="false" requestValidationMode="4.0" />
        <customErrors defaultRedirect="~/ErrorPages/WebCatError.aspx" mode="RemoteOnly"/>
        <compilation debug="true">
              <add assembly="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <!--The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user.-->
        <authentication mode="Forms">
            <forms cookieless="UseDeviceProfile" defaultUrl="Admin/AdminMenu.aspx" loginUrl="Login.aspx" name=".ASPXAUTH" protection="All" requireSSL="false" timeout="40" />
            <deny users="?" />
            <allow users="*" />
        <!--Made the session timeout and the form authentication timeout so that the user is redirected back to login page after 20 minutes
          and when they log back in they start with a new session as well.-->
          <sessionState cookieless="UseDeviceProfile" mode="InProc" regenerateExpiredSessionId="false" timeout="20" />
    	  <!--Uncomment this line when the rest of the application starts using WebCat.master-->
        <!--<pages theme="WebCat" masterPageFile="~/MyMaster.master" enableViewState="true"/>-->
        <pages masterPageFile="~/MyMaster.master" enableViewState="true" />
      <location path="App_Themes">
            <allow users="*"/>
      <location path="images">
            <allow users="*" />
      <location path="ErrorPages">
            <allow users="*" />

    My Directory Structure:


    Admin\All My .apsx files


    Thursday, June 13, 2013 3:49 PM


All replies

  • User-1635195291 posted

    HI there,

    Where have you places your master file. And will you paste your complete error in here please so that the cause of it could be clear.



    Thursday, June 13, 2013 5:24 PM
  • User280478734 posted
    ASP.NET runtime error: The file '/MyMaster.master' cannot be processed because the code directory has not yet been built

    The Master file is directly under the root (See the directory structure above)

    Thursday, June 13, 2013 5:28 PM
  • User71929859 posted


    Check the below solution


    Friday, June 14, 2013 8:38 AM
  • User280478734 posted

    Thanks. I moved the usercontrol registeration to the web.config file and the issue persists. The code works just fine either way, it is just not being recognized by VStudio. I do not think the issue is related to user controls, as I removed the userControls altogether, and that did not help either.

    Friday, June 14, 2013 9:12 AM
  • User-166373564 posted

    Hi pkrishnap

    According to the error message, the usage of usercontrol can lead to this issue, I would like to suggest you to check whether you use usercontrol properly,

    At the same time you can also refer the discussion that need to reference Usercontrol(ascx) in ASPX page, and check whether it can give some tips for you,


    hope it helps you,


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 20, 2013 5:34 AM