Solved

Imagehandler  not working on server

Posted on 2015-01-16
5
15 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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