0

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 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 

2 Answers 2

1

Try removing the namespace from the Inherits attribute:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_Default" %>
Sign up to request clarification or add additional context in comments.

1 Comment

Whoa that was it. How could this be? That's automatically generated by vs.
0

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
     {
         // ...

2 Comments

Yes they match as mentioned in the question. I'm suspecting a corrupt vs install.
@maatthias Try using fusion logging to diagnose the load failure - you might have referenced another assembly that couldn't be loaded. Also make sure that your project is built and up-to-date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.