ASHX file Parser error - failed to create type
I have a sample IIS install application from a vendor that I am testing to generate barcodes.
The aspx pages work fine, but when the aspx page calls the ashx page, I get the following error:
Server error in application "/ BarcodeSample".
Parser Error: An error occurred while parsing a resource required to service this request. Review the following parsing error details and modify the source file accordingly.
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 Info: 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?
source to share
Check the fully qualified class name starting with the namespace (if used). I had the same problem and it was fixed after changing the class name as follows:
<%@ WebHandler Language="C#" Class="Namespace.ClassName" %>
instead of this:
<%@ WebHandler Language="C#" Class="ClassName" %>
source to share