Visual Studio - Resolve error "The file MasterPage.master does not exist"
by
Jeremy Canfield |
Updated: September 10 2023
| Visual Studio articles
Let's say you are getting this error when attempting to view your default.aspx page in a browser. In Visual Studio, when looking at the code of the default.aspx page, notice the line MasterPageFile="~/example.Master".
<%@
Page Title=""
Language="vb"
AutoEventWireup="false"
MasterPageFile="~/example.Master"
CodeBehind="default.aspx.vb"
Inherits="example._default"
%>
Sometimes, changing the ~ (tilde) to a . (period) will resolve this error.
<%@
Page Title=""
Language="vb"
AutoEventWireup="false"
MasterPageFile="./example.Master"
CodeBehind="default.aspx.vb"
Inherits="example._default"
%>
Did you find this article helpful?
If so, consider buying me a coffee over at