Solved

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

Posted on 2010-09-09
6
1,136 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now