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?

3
  • There's a way to clear the compiled temporary internet files - have you tried that? Commented Jul 5, 2012 at 13:08
  • could you please post the whole error message or the following information - .NET Framework version, IIS version Commented Jul 5, 2012 at 13:08
  • have you tried build rebuild clean build sequence? Commented Jul 5, 2012 at 13:24

5 Answers 5

4

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

Sign up to request clarification or add additional context in comments.

Comments

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.

1 Comment

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

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

Comments

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.

Comments

0

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

Comments

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.