Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-09-09
6
Medium Priority
?
1,425 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 31

Accepted Solution

by:
MlandaT earned 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

927 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