Parser Error Debugging VS2008
When I create new VS2008 asp.net application it builds fine. But when I start debugging I get below error in browser. I've rebuilt the app. The Inherits clause of the markup page matches the class in the code-behind C#. Any clues?
Server Error in '/' Application.
--------------------------------------------------------------------------------
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开发者_C百科 and modify your source file appropriately.
Parser Error Message: Could not load type 'WebApplication3._Default'.
Source Error:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication3._Default" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File: /Default.aspx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927
Try removing the namespace from the Inherits
attribute:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_Default" %>
This is usually because the code-behind class name / namespace has changed, but the .aspx page hasn't been updated (or visa versa).
You should open up the code behind of your page and make sure that the namespace and class name match whats in your .aspx page (and that the class is marked as public).
namespace WebApplication3
{
public class _Default
{
// ...
精彩评论