place the compiled web app project in one common directory inside wwwroot folder RRS feed

  • Question

  • User364607740 posted

    I don't know if you guys have face the same problem as mine. When I place my compiled web app inside wwwroot, everything works fine. Suppose my compiled web app has directories bin, view (contains aspx pages and master page file) then web config and packages.config files.

    Now if I place these files and folders just inside my wwwroot directory 


    works fine. I can browse my web application.

    But when I put these files and folders inside one common directory say Project such that now the file path become 


    Now I get issues like 

    Parser Error Message: Could not load type 'Project.view.AdminMaster'

     Why is it so ?

    Thursday, April 4, 2019 7:27 PM

All replies

  • User475983607 posted

    Why is it so ?

    IIS configuration.  I imagine you forgot to create an application or virtual directory.

    Thursday, April 4, 2019 7:32 PM
  • User364607740 posted

    Yes, I have not created the virtual directory. What should be the path of the virtual directory for the case


    Friday, April 5, 2019 1:15 AM
  • User364607740 posted

    According to this tutorial


    Should I have to change 

    Change the "CodeBehind" in the aspx file to "CodeFile"

     I changed the CodeBehind to CodeFile but still getting the error in Master Page File

     Parser Error Message: The file '/AdminMaster.master.cs' does not exist.

    Friday, April 5, 2019 1:35 AM
  • User283571144 posted

    Hi scala_1988,

    Since the master pages use root path as the master page's code-behind path, so you will face this error.

    I suggest you could right click the project folder inside the wwwrot in IIS and click the convert to application, then it wll work well.

    Best Regards,


    Friday, April 5, 2019 5:08 AM
  • User753101303 posted


    No to me using CodeBehing or CodeFile is absolutely unrelated to this problem.

    The point that matters is the ~ symbol. I' m not sure it would be shown as part of the error message but go check your code to see if you have something such as  MasterPageFile="~/MyMasterPage.master" rather than MasterPageFile="/MyMasterPage.master"

    The ~ symbol allows to tell you want to start from the application root folder rather than from the web site root folder which does matter when your application is not installed at the site root but beneath it.

    Edit: and to clarify you need both ie make sure you followed also as well Brando ZWZ advice. It allows to tell IIS this is not just a folder under your web site root but that you really want a web application under your web site root. See perhaps https://docs.microsoft.com/en-us/iis/get-started/planning-your-iis-architecture/understanding-sites-applications-and-virtual-directories-on-iis#about-sites-applications-and-virtual-directories-in-iis-7-and-above

    Friday, April 5, 2019 11:15 AM