Solved

Imagehandler  not working on server

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to redirect sub-domains on IIS 4 56
Upgrade code from VS 2010 to VS 2015 7 45
Securing WEBAPI on Azure 2 56
Adding Rows to Grid 4 34
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

752 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