Solved

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

Posted on 2010-09-09
6
1,165 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remove a text string from the end of another string 5 29
Handle null when using linq in this line 1 26
asp.net mvc return json 2 53
Json and asp.net mvc 2 44
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

919 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

12 Experts available now in Live!

Get 1:1 Help Now