1

I am getting the common ASP.NET YSOD error. Here is the full error page as requested:

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 'WebApplication1.WebForm1'.

Source Error: 

Line 1:  <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1" %>
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: /WebForm1.aspx    Line: 1 

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 

But only on my local machine. I tried the option to Use Local IIS Web Server and this gives the same error.

Everything I have read says 'just re-compile' I have done this but it makes no difference.

I am using VS2010.

Does anyone know what the cause of this is?

Taz
  • 3,718
  • 2
  • 37
  • 59
Matt Wilko
  • 26,994
  • 10
  • 93
  • 143

5 Answers5

4

Try deleting the existing DLL and PDB and then recompile the project.

DNR
  • 3,706
  • 14
  • 56
  • 91
2

Check the DamoDBear's Answer on this SO Thread - Parser Error Message: Could not load type 'TestMvcApplication.MvcApplication' .

There might be two reason, may be that will help in future who will face an issue.

a)The file in which we have changed it was not updated properly, so that's why It
  was causing an error,so project .dll has updated but that page was not updated 
  properly.

b)That page Excluded from the project.

so Please keep these thing in your mind. Most of the cases files was not updated.

Related MSDN Link : Bin folder location causes "Parser Error Message: Could not load type" problem

Hope this help.

Community
  • 1
  • 1
Niranjan Singh
  • 18,017
  • 2
  • 42
  • 75
  • Thanks I followed the advice in that answer and changed my build output path from `bin\x86\Debug\` to `bin\` and now it works. This looks like a bug to me. – Matt Wilko Jul 05 '12 at 13:24
1

Your code behind file must have the class named WebForm1 and within the namespace WebApplication1

SHAKIR SHABBIR
  • 1,295
  • 1
  • 14
  • 25
0

Check your project's properties, and see in "Build" Tab what the location of "Output Path" is. If it is not project's own "bin" directory, that is the reason. Web App is referencing itself as well, and if cannot find the dll in it s own bin folder, it does either not work at all at first compliation or it does not reflect your changes in the code.

HGMamaci
  • 1,339
  • 12
  • 20
0

You must have Rebuild Solution before you have to Start Debugging or Browse Application.