.ashx在IIS7上找不到类型错误,在webdev服务器上没有问题 [英] .ashx cannot find type error on IIS7 , no problems on webdev server

查看:223
本文介绍了.ashx在IIS7上找不到类型错误,在webdev服务器上没有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在IIS7
上使 AspNetComet.zip 正常工作

I am trying to make AspNetComet.zip work on IIS7 (a simple comet chat implementation) Here is a portion of my web.config.

<system.web>
    <httpHandlers>
        <add verb="POST" path="DefaultChannel.ashx" type="Server.Channels.DefaultChannelHandler, Server"/>
    </httpHandlers>
</system.web>

<system.webServer>
    <handlers>
       <add name="DefaultChannelHandler" verb="POST" path="DefaultChannel.ashx" type="Server.Channels.DefaultChannelHandler, Server"/>
    </handlers>
</system.webServer>

当我在本地IIS7上发布网站时,出现错误:

When I publish the website on my localhost IIS7 I receive an error:

POST http://localhost/DefaultChannel.ashx 500内部服务器错误

无法加载类型'Server.Channels.DefaultChannelHandler

该项目的目标框架是我尝试过的.Net 2.0 .Net 2.0的经典和集成模式应用程序池,没有运气。我还尝试了将项目转换为4.0,并尝试了.Net 4.0的经典和集成模式应用程序池,但没有成功。我还尝试通过IIS管理器的处理程序映射添加托管处理程序。

The target framework of this project is .Net 2.0 I tried the Classic and Integrated Mode application pool for .Net 2.0 with no luck. I also tried converting the project to 4.0 and tried the Classic and Integrated Mode application pool for .Net 4.0 with no luck. I also tried adding the managed handler through IIS Manager's Handler Mappings.

如果您有时间,请下载源文件(184kb),以在您自己的计算机上重现该问题。该压缩文件包含VS2010解决方案(.Net 2.0)。您也可以尝试将其转换为.Net 4.0

If you have time please download the source (184kb) to reproduce the problem on your own machine. The zip contains a VS2010 solution (.Net 2.0). You could also try to convert this to .Net 4.0

无论如何我都在使用Windows 7。如果您需要更多详细信息,请在下面添加您的评论。

I am using Windows 7 anyway if that matters. If you need more details, please drop your comments below. This is working fine by the way on my webdev server.

注意:我在这里创建了此问题的一个版本,因为我认为它很适合(基于标记和用户群)比我在SF https://serverfault.com/questions/245241/ashx-cannot-find-type-error-on-iis7-no-problems-on-webdev-server

NOTE: I created a version of this question here as I believe it suits SO better (based on the tags and user base) than what I posted on SF https://serverfault.com/questions/245241/ashx-cannot-find-type-error-on-iis7-no-problems-on-webdev-server

推荐答案

这是来自methodworx的AspNetComet的示例聊天代码。将其部署到本地开发环境时。我假设您没有自己的域,因此您将在默认网站下创建一个Web应用程序。这使得 http://localhost/DefaultChannel.ashx 和无效的路径。

This is an example chat code of AspNetComet from methodworx. When deploying it to your local development environment. I would assume that you don't have your own domain thus you will create a web application underneath the Default Website. That makes http://localhost/DefaultChannel.ashx and invalid path.

然后,您必须添加与此类似的Web应用程序的目录名称。 http://localhost/WebApplicationName/DefaultChannel.ashx 。另一方面,AspNetComet将遇到另一个错误,例如 comet客户端不存在

You then have to append the directory name of web application similar to this. http://localhost/WebApplicationName/DefaultChannel.ashx . On the other hand AspNetComet will encounter another error something like comet client does not exist.

我已通过将服务引用 .svc 转换为 .asmx 网络服务。

I have resolved this by converting the service reference .svc to a .asmx web service.

这篇关于.ashx在IIS7上找不到类型错误,在webdev服务器上没有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆