• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1035
  • Last Modified:

Parser Error Message: Could not load type

I have a .ASP/ASP.NET applications running on Windows 2003 Server.

The ASP.NET is 1.1

I have an existing .ASPX page 'FullBatteryTest.aspx' that I needed to enhance.

I created a new .ASPX page 'FullBatteryTestNew.aspx', with a new .aspx.cs file

The new page works perfectly on my development computer.

I have rebuilt the page, website, and solution.

I have attempted to just copy the new pages the the development server.

I have backed up and copied the entire website to the production server.

Every other .aspx page is serving correctly. My folder is an 'application'

I have checked case as well

I am still getting the following error:
Server Error in '/PICS' 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 'PICS.FullBatteryTestNew'.
 
Source Error: 
 
 
Line 1:  <%@ Register TagPrefix="cc1" Namespace="GTIControls" Assembly="GTIControls" %>
Line 2:  <%@ Page language="c#" CodeBehind="FullBatteryTestNew.aspx.cs" AutoEventWireup="false" Inherits="PICS.FullBatteryTestNew" %>
Line 3:  <%@ Register TagPrefix="RSI" Namespace="RSI.Controls" Assembly="Templates" %>
Line 4:  <RSI:MASTERPAGE id="MPContainer" runat="server">
 
 
Source File: D:\NewPICS\fullbatterytestnew.aspx    Line: 2 
 
 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
 
********************************************************************************************
The first few lines from 'FullBatteryTestNew.aspx.cs. ("using ... excluded" )
 
using System.Web.UI.HtmlControls;
 
namespace PICS
{
	/// <summary>
	/// Summary description for FullBatteryTestNew.
	/// </summary>
	public partial class FullBatteryTestNew : System.Web.UI.Page
	{

Open in new window

0
revstudio
Asked:
revstudio
  • 10
  • 5
  • 4
1 Solution
 
GiftsonDJohnCommented:
Hi,

Have you copied the compiled dll? Asp.net 1.1 i.e. Visual Studio 2003 will compile the pages every time and those dll file will be used for processing the page not the codebehind file. Can you check whether you have updated the dll file in the bin folder.
0
 
samtran0331Commented:
>>I have rebuilt the page, website, and solution.

>>I have attempted to just copy the new pages the the development server.

After you compiled the project with the new page and copied the pages to the server...did you also copy over the main dll into the \bin folder on the server?
0
 
revstudioAuthor Commented:
I am using VS2005. I copied everything over. I thought there should be a PICS.dll file in the \bin folder but there wasn't. There isn't one on the production server either though. I also looked in the GAC for 1.1 and I don't see any reference there either.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
GiftsonDJohnCommented:
You can't use VS2005 for asp.net 1.1 projects. It will be asp.net 2.0.

remove the

namespace PICS
{

from your code.    
0
 
revstudioAuthor Commented:
I was afraid of that but I can't run VS2003 on Vista 64bit...

What will removing the namespace accomplish?
0
 
revstudioAuthor Commented:
Or maybe I can install VS2003, I'm trying now
0
 
samtran0331Commented:
Visual Studio 2005 can't open a .Net 1.1x web app.
If you are compiling successfully in Visual Studio 2005, I would guess that the application (your local copy) is running on .Net 2.x and not 1.1.x
If that is the case, I would guess that you have not uploaded the newer compiled dll or web.config...else you'd be getting different errors.

Does your app run without errors locally with the new page?
0
 
revstudioAuthor Commented:
Works fine locally. I only get errors on that one page.

Trying to install VS2003, I'll update thread shortly.
0
 
GiftsonDJohnCommented:
Hi,

>>public partial class FullBatteryTestNew : System.Web.UI.Page

partial class is only from .net 2.0 and above. So make sure that you have defined correct Asp.Net version.
0
 
revstudioAuthor Commented:

This line is in FullBatteryTest.aspx.cs (original version) and it is working just fine on 1.1 site.

>>public partial class FullBatteryTest : System.Web.UI.Page
0
 
revstudioAuthor Commented:
Like I said I copied the original file, and simply appended 'New' to the end of everything.
0
 
GiftsonDJohnCommented:
Please check this link

http://www.dotnet-guide.com/partialclasses.html

Partial classes are new in 2.0 and it is not there in 1.1
0
 
revstudioAuthor Commented:
So how is it working?
namespace PICS
{
	/// <summary>
	/// Summary description for FullBatteryTest.
	/// </summary>
	public partial class FullBatteryTest : System.Web.UI.Page
	{

Open in new window

screenshot.jpg
0
 
revstudioAuthor Commented:
I'm not being argumentative, please don't take it that way. But this has been baffling me for about a week now. I'm just trying to make sense of this.
0
 
samtran0331Commented:
You have to remember that when you say "ASP.Net 2.0"...there are 2 sides to it...the development side and the "what runs in IIS" side...the actual application.
What GiftsonDJohn said is true, partial classes are new to 2.0...the development side.
And partial classes are simply a way of organizing code...once the code is compiled..the code in the dll it has become MSIL (Microsoft Intermediate Language)..the partial classes are no longer relevant...the code is now more "low level"

Same with IIS...IIS doesn't see/care/know about the classes...the worker process is just simply interpreting the dll.

So the results you're seeing are possible.  
The same way it is possible to take a basic 1.1x app and simply change it in IIS to run under 2.0.


So you said everything works fine locally.
Are you testing using VS2005's internal web server or on your local IIS?
If you're using the Vs2005 "server" then your app is running under 2.0 locally.
If you're using your local IIS, what version of ASP.Net are you running locally?
If it's 1.1x, flip it over to 2.0 and see what happens.

Besides this new page, all other files are the same (between your local copy and the server copy)?
I'm most curious about the web.config...if there are any differences between what is on the server and what you have locally.

A 1.1x web.config usually starts like:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>      


And a 2.x web.config usually starts like:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <configSections>

0
 
revstudioAuthor Commented:
I am running it locally using the VS2005 Web Server.

I have also tried changing the .NET version on the production server to 2.0... but that didn't help either.

The web.config file starts...

<?xml version="1.0"?>
<configuration>
      <appSettings>

I did NOT copy the web.config file from my development box to the production server.
0
 
samtran0331Commented:
>>I have also tried changing the .NET version on the production server to 2.0... but that didn't help either.

But the app does run on the production server after you set it to 2.0 in IIS?  
Just your change to the one page (still) doesn't work?


>>I am running it locally using the VS2005 Web Server.
I would test it under your local IIS instead of the VS web server.
If all goes well, I would then do a "publish" and replace the app on the server.

0
 
revstudioAuthor Commented:
IIS says v1.1 on the production server.

If I change it to 2.0 (which it has never been set at) the error goes away but now some of the code behind fails.

I am not sure what is going on but I'm tired of jerking around with it. I am doing as you suggested. I'm going to get it working as a 2.0 site on my local IIS and then publish it.
0
 
samtran0331Commented:
Just use the "ask a related question" feature in this question if you have any issues getting your local version up and running. Good luck!
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 10
  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now