Solved

Imagehandler  not working on server

Posted on 2015-01-16
5
19 Views
Last Modified: 2016-07-12
Hi
I have created an Imagehandler (ashx)  "class ImageHandler : IHttpHandler {" that I use in my website.
I use this to display jpeg images on my site. It Works fine when I run the Project from VisualStudio, but when I deploy it to the web server it stops working. I have tried the solution that normaly comes up when I Google this problem:
Add the handler to the handlers section under system.webserver:

"
<add name="ImageHandler_ashx" path="*.ashx" verb="*" type="ImageHandler" preCondition="integratedMode" />

    </handlers>
  </system.webServer>
"
Its Windows server 2008R2 and IIS 7.5
But it doesnt work, I'm i missing something here?
0
Comment
Question by:staleb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Expert Comment

by:sudheeshthegreat
ID: 40554802
Is the ImageHandler class part of an assembly that is deployed in the website's bin directory?
It would be better to add the assembly name as well when you mention the type. It should appear as "classname, assemblyname".

Also, make sure that *.ashx does not already have a mapping handler, configured in IIS.
0
 

Author Comment

by:staleb
ID: 40555156
Hi the image handler is not part of an Assembly, it's a separate file that get published.
I tried it in the app_code folder, but now its at the root folder of the website
0
 
LVL 9

Expert Comment

by:sudheeshthegreat
ID: 40557085
I didnt understand when you said it is not part of an assembly, The dll file needs to be placed in the website's bin folder, along with other such dll files of the website.
0
 

Accepted Solution

by:
staleb earned 0 total points
ID: 40557151
Hi
The handler is a .ashx file. and when I publish the web Project it stays as   a .ASHX file. It doesnt get compiled into a .dll.

I think I found the solution:
I didnt have a codebehind file, but I have added one now that I put i the App_code folder, and then the "publish" made an dll of that folder. Now it Works.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question