Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load type 'WebApp1._Default' in ASP.NET

Tags:

asp.net

When I am running my ASP.NET application I will get an error

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

like image 788
Sauron Avatar asked Nov 10 '09 13:11

Sauron


2 Answers

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

like image 112
Bravax Avatar answered Sep 19 '22 16:09

Bravax


have you set your web app directory as application in IIS?

I have seen this error many times for different reasons.

  1. Check namespace
  2. dependent dll versions
  3. Visual studio clean and compile again.
  4. clean temp asp.net files "Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files"
like image 28
Saar Avatar answered Sep 17 '22 16:09

Saar