Error: “The file '/MasterPages/MainMaster.master' does not exist.” (Yes, this file does exist!)

后端 未结 7 1178
被撕碎了的回忆
被撕碎了的回忆 2021-02-10 01:15

I just got a new desktop computer with Windows 7 Pro as the operating system. I installed Visual Studio 2008 on to this new computer and tried to open a previously existing ASP.

相关标签:
7条回答
  • 2021-02-10 01:41

    I recently had to move my websites from one server(32 bit) to another server(64 bit). On the new server I experienced the file not found error "Parser Error Message: The file '~/Master.master' does not exist"

    NB: some of my applications were built for x86, you still need to convert your website to an application :-)

    Solution: In IIS8, click Application Pool -> select an app pool eg DefaultAppPool -> click 'Advanced Settings' -> Under the 'General' section set 'Enable 32-Bit Applications' to 'True' -> Click OK

    Refresh your website/webservice and that should do the trick

    0 讨论(0)
  • 2021-02-10 01:41

    previous code:-

    after code changed:-

    change the code from everywhere from "~/admin.Master" to "~/ocs/admin.Master"

    0 讨论(0)
  • 2021-02-10 01:49

    I appreciate your response.

    However, this issue turned out to be an IIS7 issue. The error message I described arose out of the distinction made in IIS7 between a "virtual directory" and an "application" (I don't know if such a distinction existed in IIS6). To fix this error, I opened IIS7, right-clicked on the virtual directory folder for this site, and selected "Convert to Application." I then refreshed the browser, and the error went away.

    Sigh.

    0 讨论(0)
  • 2021-02-10 01:57

    Two things to check:

    1. When using "~" in a file path, make sure that the current application deployment believes the root directory is the same as it was before. (I've run into this sometimes moving an app from the VS Development Server and IIS.)

    2. Make sure that the user account that the server is running under has permissions to access that directory. Since you just moved the code over from another computer and probably some intermediate storage devices, the security permissions may not be right.

    0 讨论(0)
  • 2021-02-10 01:58

    previous code:-

    <%@ Page Title="" Language="C#" MasterPageFile="~/admin.Master" AutoEventWireup="true" CodeBehind="outgoingform.aspx.cs" Inherits="OCS.outgoingform" %>
    

    after code changed:-

    <%@ Page Title="" Language="C#" MasterPageFile="../ocs/admin.Master" AutoEventWireup="true" CodeBehind="outgoingform.aspx.cs" Inherits="OCS.outgoingform" %>
    

    change the code from everywhere from "~/admin.Master" to "~/ocs/admin.Master"

    0 讨论(0)
  • 2021-02-10 02:00

    Instead of the "~" I was able to simply change the directory to a relative ".." So, what I originally had that gave me the problem was something like: "~/MasterPage/TheMainMasterPage.master" and this caused me to get the same error message. Changing it to "../MasterPage/TheMainMasterPage.master" fixed everything for me.

    0 讨论(0)
提交回复
热议问题