Failed to load type "WebApp1._Default" in ASP.NET

When I start an ASP.NET application, I get an error

Server error in application "/".

Analyzer Error Description. An error occurred while analyzing the resource needed to service this request. Review the following parsing error details and modify the source file accordingly.

Parser error message: Failed to load type 'WebApp1._Default'.

Source Error:

Line 1: <% @ Page Language = "C #" AutoEventWireup = "true" CodeBehind = "Default.aspx.cs" Inherits = "WebApp1._Default"%> Line 2:
Line 3:

Source file: /Default.aspx Line: 1


Version Information: Microsoft.NET Framework Version: 2.0.50727.3053; ASP.NET Version: 2.0.50727.3053

How can I solve this problem?

+7
source share
6 answers

Verify that your DLL is in the bin folder. (Not bin / debug ...).

+6
source share

Have you installed your web application directory as an application in IIS?

I have repeatedly seen this error for various reasons.

  • Check namespace
  • dependent dll versions
  • Visual Studio clean and compile again.
  • clean asp.net temp files "Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files"
+4
source share

Have you renamed the namespace or class name in the code file? Open the code file and verify that the namespace for the page is called WebApp1 and that the class is called _Default , or update the Inherits attribute in the aspx page header to match the code.

+2
source share

Did you indicate that your _Default class is under the WebApp1 namespace in the Default.aspx.cs file?

Please check.

0
source share

For me, somehow the code file was deleted from the project. They appeared with a different icon in the solution explorer. I just needed to expand the ASPX line to see the code, and then right-click and add it to the project.

0
source share

Try in the section "Settings / project assembly" set the OutputPath to "bin", not "bin \ debug". that was my problem.

0
source share

All Articles