.ashx cannot find type error on IIS7 , no problems on webdev server
- by Aivan Monceller
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>
When I publish the website on my localhost IIS7 I receive an error:
POST http://localhost/DefaultChannel.ashx 500 Internal Server Error
Could not load type 'Server.Channels.DefaultChannelHandler
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.
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
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.