locked
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"?>
    <configuration>
      
      <system.webServer>
        
        <directoryBrowse enabled="false" />
        
        <modules>
            <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" />
        </modules>
        
        <httpProtocol>
            <customHeaders>
                <remove name="X-Powered-By" />
            </customHeaders>
        </httpProtocol>
           
      </system.webServer>
    
         
        <httpRuntime enableVersionHeader="false" requestValidationMode="4.0" />
        <customErrors defaultRedirect="~/ErrorPages/WebCatError.aspx" mode="RemoteOnly"/>
        
            
        <compilation debug="true">
          <assemblies>
              <add assembly="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
          </assemblies>
        </compilation>
        
        <!--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" />
        </authentication>
        
          <authorization>
            <deny users="?" />
            <allow users="*" />
          </authorization>
      
        <!--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" />
    
      
      </system.web>
    
      <location path="App_Themes">
        <system.web>
          <authorization>
            <allow users="*"/>
          </authorization>
        </system.web>
      </location>
      
      <location path="images">
        <system.web>
          <authorization>
            <allow users="*" />
          </authorization>
        </system.web>
      </location>
    
      <location path="ErrorPages">
        <system.web>
          <authorization>
            <allow users="*" />
          </authorization>
        </system.web>
      </location>
      
    </configuration>


    My Directory Structure:

     

    ROOT
    
    Admin\All My .apsx files
    Admin\UserControls\
    App_Code
    App_Themes
    ErrorPages
    images
    global.asax
    Login.aspx
    Logout.aspx
    MyMaster.aspx
    SiteMap.aspx
    web.config

                                      

    Thursday, June 13, 2013 3:49 PM

Answers

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.

    Thansk,

    Jatin

    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

    Hello,

    Check the below solution

    http://www.cnblogs.com/dys3996/archive/2007/08/01/838633.html

    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,

    http://stackoverflow.com/questions/8618656/need-to-reference-usercontrolascx-in-aspx-page-in-more-than-one-place-with-dif

    hope it helps you,

    Regards

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