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

倖福魔咒の 提交于 2019-12-03 16:12:04

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.

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.

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.

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

user7041099

the error comes on the web form like this

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site1.Master" CodeBehind="add_drivers.aspx.vb" Inherits="au_transport.WebForm1" %>

correction

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="Site1.Master" CodeBehind="add_drivers.aspx.vb" Inherits="au_transport.WebForm1" %>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!