locked
Retrograding httpHandler from .NET 2.0 to 1.1, get "Parser Error Message: Could not create type" message RRS feed

  • Question

  • User197111389 posted

    Hi there,

    I have written a httpHandler using VS2005 and .NET 2.0 that builds and works fine.

    However, I am now having to convert it to .NET 1.1, which I hoped would just be a case of changing the runtime used by the web app (as in running the 1.1 version of aspnet_regiis, with a "-s" switch pointing at my web apps folder). After doing this though (and fixing a few minor differences with web.config), if I then navigate to my handler I get the following error message:

    Server Error in '/Path/To/MyWebApp' 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 create type 'MyNamespace.MyHandler'.

    Source Error:

    Line 1:  <%@ WebHandler Language="C#" Class="MyNamespace.MyHandler" CodeBehind="MyHandler.cs" %>


    Source File: c:\inetpub\wwwroot\Path\To\MyWebApp\MyHandler.ashx    Line: 1

    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

     

    Here are the (abridged) contents of the files involved:

    MyHandler.ashx:

    <%@ WebHandler Language="C#" Class="MyNamespace.MyHandler" CodeBehind="MyHandler.cs" %>

     

    MyHandler.cs:

    using System.Web;

    namespace MyNamespace {
    public class MyHandler : IHttpHandler {
    	//rest of code goes here, ProcessRequest etc.             

     

    The only possible solutions to this error I can find is to make sure that the namespace is included. However I don't think this is the cause of my problem as my app builds and works ok under .NET 2.0. 

    Any help gratefully received,

    Neil.

    Friday, September 8, 2006 9:02 AM

Answers

  • User197111389 posted

    I've resolved my problem by getting hold of a copy of VS2003, creating a new web project, and adding the .ashx and .cs files from my VS2005 project to it. Building the project resulted in no errors and it now runs perfectly. I think I would probably recommend to others in a similar situation to utilise the version of VS that natively supports the runtime they wish to use to build the project, if they can.

    Thanks for your help,

    SME 

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 12, 2006 9:41 AM

All replies

  • User371668647 posted
    I'd recommend checking the generated dll with Reflector to verify that the namespace is what you expect.  Also, check the entry in the web.config that instantiates the handler to verify that it's referencing the correct assembly.
    Friday, September 8, 2006 2:17 PM
  • User197111389 posted

    I've resolved my problem by getting hold of a copy of VS2003, creating a new web project, and adding the .ashx and .cs files from my VS2005 project to it. Building the project resulted in no errors and it now runs perfectly. I think I would probably recommend to others in a similar situation to utilise the version of VS that natively supports the runtime they wish to use to build the project, if they can.

    Thanks for your help,

    SME 

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 12, 2006 9:41 AM