asp.net - ASHX 文件解析器错误 - 无法创建类型

标签 asp.net iis-6 ashx

我从供应商处获得了一个要安装在 IIS 上的示例应用程序,我正在测试该应用程序是否制作条形码。

aspx页面工作正常,但是当aspx页面调用ashx页面时,出现以下错误:

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

为什么会发生这种情况?我怎样才能让这个 ashx 文件工作?

最佳答案

从命名空间开始检查类的全名(如果使用)。我遇到了同样的问题,在更改类名后解决了这个问题:

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

而不是这个:

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

关于asp.net - ASHX 文件解析器错误 - 无法创建类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14822295/

相关文章:

c# - jQuery中触发文本框的change事件

wcf - 404 BadRequest使用IIS主机 header 通过外部IP公开WCF服务

asp.net - 部署网站后在 SharePoint 中禁止 403

HTML5 视频 - ashx 处理程序 - 寻求

asp.net - 如何查看一个网站有多少人在线

java - 重用函数 Angular 1

c# - 损坏的查询字符串 : "80" being removed by IIS?

c# - 从 byte[] 数组在 ashx 中创建一个 excel 文件以供客户端下载

asp.net - ASSX 处理程序返回 500 内部服务器错误

javascript - 在 Telerik RadPageView 完成加载后调用 JavaScript 函数?