2
votes

I have this directory structure:

[website]
  [folder]
    Default.aspx
  Default.aspx
  Web.config

The Page Directive in the file in [folder] was created by Visual Studio 2010 when I added a new Web Form using Master Page:

<%@ Page Title="" Language="C#" MasterPageFile="~/Page.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="website.folder.Default" %>

When I run this application in the debugger (using localhost), it works fine.

When I push it up to the server (Windows Server 2003 R2), that same page produces a Parser Error on the Page Directive line:

Parser Error

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 '/website/folder/Page.Master' does not exist.

Source Error:

Line 1: <%@ Page Title="" Language="C#" MasterPageFile="~/Page.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="website.folder.Default" %>
Line 2:

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1008

What needs to be configured on the server to eliminate this error message?

1
It looks like your server is treating /folder as the root folder.MikeSmithDev
@MikeSmithDev: Yes, I agree. I do not know how to stop that behavior, though.jp2code
Can you actually navigate to that root default.aspx or was the site just configured incorrectly in IIS? (going to thesite.com/default.aspx is the page in folder)MikeSmithDev
@MikeSmithDev: Yes, I can navigate to the root. Each of the different folders within root is going to be a separate project.jp2code

1 Answers

2
votes

On our server, I used IIS Manager to delete all of the files in the [website] folder, then republished it through Visual Studio 2010.

It seems to be working now.

Clearly, I don't know enough about how the whole IIS system works!