Click here to Skip to main content
12,448,059 members (90,710 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET Parsing
Hi!
Now, I know what you're thinking ("Not another parser error!"). But my situation is unique. (No, really! Wink | ;-) ) 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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 

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?

Thanks!
Posted 30-Apr-12 6:44am
Comments
B Birajdar 1-May-12 0:50am
   
My +5. For nicely framed question
B Birajdar 1-May-12 0:51am
   
Reason for my vote of 5
Well explained question
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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 ?
  Permalink  
Comments
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 : http://stackoverflow.com/a/6078834/2377928
B Birajdar 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 asp.net and encountered similar error. So I made a diff and found the difference. I made the above change and voila...it worked...
B Birajdar 2-May-12 1:56am
   
This link throws some light on it http://msdn.microsoft.com/en-us/magazine/cc163675.aspx
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 :)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Try to copy the bin folder to your webserver.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

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.
  Permalink  
v3
Comments
KrunalRohit 2-Dec-15 7:28am
   
Well, issue was solved ages ago.

-KR
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


Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 2 Dec 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100