ASHX file Parser error - could not create type

richard picture richard · Feb 11, 2013 · Viewed 11.9k times · Source

I got a sample application to install on IIS from a vendor that I am testing for making barcodes.

The aspx pages work fine, but when the aspx page calls the ashx page, I get the error below:

Server Error in '/BarcodeSample' 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 'TECIT.OnlineBarcodes.BarcodeHandler'.

Source Error:

Line 1: <%@ WebHandler Language="C#" CodeBehind="BarcodeHandler.ashx.cs" Class="TECIT.OnlineBarcodes.BarcodeHandler" %>

Source File: /BarcodeSample/BarcodeHandler.ashx Line: 1

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

Why is this happening? How can I get this ashx file to work?

Answer

Shadi Namrouti picture Shadi Namrouti · May 24, 2015

Check the full name of the class starting from the namespace (if used). I had the same issue and it was fixed after changing the class name like this:

<%@ WebHandler Language="C#" Class="Namespace.ClassName" %>

instead of this:

<%@ WebHandler Language="C#" Class="ClassName" %>