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.
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
previous code:-
after code changed:-
change the code from everywhere from "~/admin.Master" to "~/ocs/admin.Master"
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:
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.)
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.
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"
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.