Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Parser
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 at 1-May-12 0:50am
   
My +5. For nicely framed question
B Birajdar at 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 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 at 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 at 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 at 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 at 2-May-12 1:56am
   
This link throws some light on it http://msdn.microsoft.com/en-us/magazine/cc163675.aspx
KYAW MYO AUNG at 23-Jul-14 5:31am
   
Thanks you for your help
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Try to copy the bin folder to your webserver.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 554
1 Gihan Liyanage 338
2 RyanDev 248
3 Sergey Alexandrovich Kryukov 243
4 ChauhanAjay 220
0 Sergey Alexandrovich Kryukov 9,011
1 OriginalGriff 7,941
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 15 Apr 2014
Copyright © CodeProject, 1999-2014
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