Click here to Skip to main content
14,875,846 members
Please Sign up or sign in to vote.
5.00/5 (3 votes)
See more:
Now, I know what you're thinking ("Not another parser error!"). But my situation is unique. (No, really! ;-) ) I could use your help. Let me tell you what the error is:

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 'TestCert'.

Source Error:

Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestCert.aspx.cs" Inherits="TestCert" %>
Line 2:
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

Source File: /TestCert.aspx    Line: 1

Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634

The situation is I have a bunch of .aspx and .aspx.cs files behind https, all in a lump together. There is no solution file and no project file (not my idea).

What I've tried so far:
1. The project file is called TestMMW, so the whole thing was under the namespace TestMMW. I tried taking the namespace off (which you see up above). Error.
2. I tried putting the namespace back on. Error.
3. I noticed that it's running under version 2 of .Net and ASP.NET, so I installed Visual Studio 2008 (to be sure - I generally work under VS 2010), compiled under there, making sure the .Net version was 2.0, and FTPd it over. Error.

I'm at a loss for what to try next. Can you help me, please?

Updated 29-Dec-20 8:35am
bbirajdar 1-May-12 0:50am
My +5. For nicely framed question
bbirajdar 1-May-12 0:51am
Reason for my vote of 5
Well explained question

Check that the codebehind class is

public partial class TestCert:Page


Also try changing CodeBehind="TestCert.aspx.cs" to CodeFile="TestCert.aspx.cs". This change is required when you change project type from website to webapplication or vice versa.

Since you are saying that the project does not contain the project file or solution file, I think the problem is here. The IIS is not able to understand the project type.

Since you are FTPing to IIS, are you sure that you are using the .NET 2.0 AppPool ?
Miriam Weiss 1-May-12 16:08pm
Can you explain to me why the CodeFile versus the CodeBehind? It worked, but I would like to know why.
Amogh Natu 12-Aug-13 7:56am
I did the same but with still the same result. I searched else where and found a stackoverflow forum that suggests me to change the output directory to Bin. I did that and still I'm having the same error. Can anyone help please? Thank you!

Stack overflow link :
bbirajdar 2-May-12 1:52am
I am glad I could help you.

I dont know the exact reason but once I added some pages from a website to a webapplication in and encountered similar error. So I made a diff and found the difference. I made the above change and worked...
bbirajdar 2-May-12 1:56am
This link throws some light on it
KYAW MYO AUNG 23-Jul-14 5:31am
Thanks you for your help
Clark Kent123 30-Sep-14 15:25pm
I know that this is an old post, but this has solved my problem! Thanks! +5 :)
Mohammad Mansoor Haddad 26-Feb-18 6:50am
changing from code behind to codefile it works like a magic. Thanks for saving time.
Balaji Gopikrishna 18-Mar-18 11:45am
Thanks a lot for your help...
Had the same issue, solved by verifying the Netframework versión of the application pool in IIS. My application was versión 4.0 and the application pool was 2.0 . Changed it for the App pool from 2.0 to 4.0 and it worked fine, no need to change the CodeBehind to CodeFile.
Try to copy the bin folder to your webserver.
Hi, what i did to solve my problem giving the same message was to go to IIS and check if it is configured as an Application or simply as a virtual directory. The App icon was just a folder icon. So i right clicked it and Manage Virtual directory > Advanced Settings > convert to Application changed the icon of virtual directory to a green earth icon. Of course the app was targeting framework 4.5, so changed App pool to 4.0 from default app pool, which was there earlier. This solved the issue for me.

But some things i did not say, 1. I am running it locally on IIS 6.1. 2. I am accessing with domain credential and not with 'pass through' authentication. Hope this helps.
Krunal Rohit 2-Dec-15 7:28am
Well, issue was solved ages ago.

RagsLuvsToCod 2-Dec-15 7:51am
surely, somebody is gona hope to find another method to try, @KR, right ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900