Solved

Parser Error Message: The file '/theMaster.Master' does not exist.

Posted on 2010-09-09
6
1,208 Views
Last Modified: 2012-05-10
Working with master pages for the first time. I keep receiving a parser error when I try to load a page that utilizes my master page called theMaster.Master. I thought it was something I mucked up somewhere else in my code so I started again from scratch, left all the automatically generated code alone and I'm still receiving the error.

Below is the entire error I'm receiving. What's the solution?

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The file '/theMaster.Master' does not exist.

Source Error:


Line 1:  <%@ Page Title="" Language="C#" MasterPageFile="~/theMaster.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Logan.Default" %>
Line 2:  <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
Line 3:  </asp:Content>

Source File: /logan_photo/default.aspx    Line: 1
0
Comment
Question by:ThePATMAN26
  • 3
  • 2
6 Comments
 
LVL 38

Expert Comment

by:Tom Beck
ID: 33642258
What does your master page directive look like? It should look like this:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="theMaster.master.cs" Inherits="Logan.theMaster" %>
0
 

Author Comment

by:ThePATMAN26
ID: 33643011
tommyBoy - that's exactly what I have.
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 33643116
Try replacing the tilde (~/theMaster.Master) with a period (./theMaster.Master).
Check that all code behind names match the names in the Page directives exactly.
Is this happening inside your development environment or after deployment or both?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:ThePATMAN26
ID: 33643509
tried changing the ~ to . - no change. It does work in Visual Studio. I started a new project, kept it very simple and it again works in the development environment but won't work live. I've attached the Master file and default web form using the master page.
Default.aspx
Test.Master
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 33651222
I copied and pasted your markup to a new master page project in VS 2005. It worked in VS and it worked when I deployed it to a web server.

Could there be a mismatch of the IIS version or .NET framework version between your development environment and the web server?
0
 
LVL 30

Accepted Solution

by:
MlandaT earned 500 total points
ID: 33652457
It is advisable to use "~". The problem is probably not related to .NET Framework version differences. It is most likely related to the IIS configuration of the site, particularly the applications root directly.

1. Make sure that you have marked the site as an application in your IIS Manager.
2. Make sure that you configure the application root directory to the correct path, for example, if the site is in c:\inetpub\wwwroot\MySite, the Website should point to that exact folder in the IIS Manager.
- If you DO NOT create a virtual directory for the application in IIS, you will stil be able to browse the site as http://localhost/MySite... BUT in this case, the application root directory (represented by ~) is actaully the c:\inetpub\wwwroot folder.
- What you want is to be able to browse http://localhost/MySite but for that to actaully be the application root. So you need to create a new application/virtual folder in IIS that points to c:\inetpub\wwwroot\MySite, then ~ will resolve correctly.

However, if you want your application to just be accessed without a virtual folder i.e. http://localhost/ on the production server to just fire up your applicaiton without requiring the "MySite" to be specified like so http://localhost/MySite, then you need to change teh Home Directory of your Website in IIS. So if you are using Default Web Site, you need ot change default website to point to c:\inetpub\wwwroot\MySite instead of c:\inetpub\wwwroot\.

Hope this clarifies things for you and hope it resolves your problem.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question