Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-09-09
6
Medium Priority
?
1,360 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

722 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