Last post Apr 05, 2019 11:15 AM by PatriceSc
Apr 04, 2019 07:27 PM|scala_1988|LINK
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.
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 ?
Apr 04, 2019 07:32 PM|mgebhard|LINK
Why is it so ?
IIS configuration. I imagine you forgot to create an application or virtual directory.
Apr 05, 2019 01:15 AM|scala_1988|LINK
Yes, I have not created the virtual directory. What should be the path of the virtual directory for the case
Apr 05, 2019 01:35 AM|scala_1988|LINK
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.
Apr 05, 2019 05:08 AM|Brando ZWZ|LINK
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.
Apr 05, 2019 11:15 AM|PatriceSc|LINK
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