Answered by:
Cannot call to handler.ashx in Vista IIS7

Question
-
User-1179262497 posted
I just moved to Vista with IIS7 from XP (IIS 6). Now, everything works fine except the handler is not working and it will throw a Visual Studio Just In Time debugger out.
The handler is just a simple image handler, which takes in an ID and then find in database and then return as content type of image.
Is there something I am missing?
Saturday, May 9, 2009 10:42 AM
Answers
-
User-1179262497 posted
I dont know why it's not working.
This is my handler:
namespace CoreApp{
public class WebPreviewHandler : IHttpHandler{
and then in web.config i have:
<
handlers> <remove name="WebServiceHandlerFactory-Integrated" /><
remove name="ScriptHandlerFactory" /> <remove name="ScriptHandlerFactoryAppServices" /><
remove name="ScriptResource" /> <add name="WebPreviewHandler" verb="*" path="*.ashx" type="CoreApp.WebPreviewHandler,CoreApp.dll" /><
add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /><
add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /></
handlers>When I run the handler directly, it says:
Could not load file or assembly 'CoreApp.dll' or one of its dependencies. The system cannot find the file specified
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, May 9, 2009 10:04 PM -
User624841477 posted
Hi,
try adding entry in Machine.config file as ....
<add path="*.ashx" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
Regards,
Sunil
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, May 9, 2009 11:01 PM -
User1054194070 posted
I dont know why it's not working.Try these:
<httpHandlers><o:p></o:p>
<add verb="*" path="*.ashx" validate="false" type="CoreApp.WebPreviewHandler, CoreApp" /><o:p></o:p>
</httpHandlers><o:p></o:p>
<handlers><o:p></o:p>
<add name="WebPreviewHandler" verb="*" path="*.ashx" type="CoreApp.WebPreviewHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" /><o:p></o:p>
</handlers><o:p></o:p>
It's not an ASP.NET MVC application, is it?
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, May 10, 2009 12:34 AM
All replies
-
User1054194070 posted
Try adding your ashx handler to the list of managed handlers in IIS Manager. See the example here.Saturday, May 9, 2009 2:10 PM -
User-1179262497 posted
I dont know why it's not working.
This is my handler:
namespace CoreApp{
public class WebPreviewHandler : IHttpHandler{
and then in web.config i have:
<
handlers> <remove name="WebServiceHandlerFactory-Integrated" /><
remove name="ScriptHandlerFactory" /> <remove name="ScriptHandlerFactoryAppServices" /><
remove name="ScriptResource" /> <add name="WebPreviewHandler" verb="*" path="*.ashx" type="CoreApp.WebPreviewHandler,CoreApp.dll" /><
add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /><
add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /></
handlers>When I run the handler directly, it says:
Could not load file or assembly 'CoreApp.dll' or one of its dependencies. The system cannot find the file specified
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, May 9, 2009 10:04 PM -
User624841477 posted
Hi,
try adding entry in Machine.config file as ....
<add path="*.ashx" verb="*" type="System.Web.HttpForbiddenHandler" validate="True"/>
Regards,
Sunil
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, May 9, 2009 11:01 PM -
User1054194070 posted
I dont know why it's not working.Try these:
<httpHandlers><o:p></o:p>
<add verb="*" path="*.ashx" validate="false" type="CoreApp.WebPreviewHandler, CoreApp" /><o:p></o:p>
</httpHandlers><o:p></o:p>
<handlers><o:p></o:p>
<add name="WebPreviewHandler" verb="*" path="*.ashx" type="CoreApp.WebPreviewHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" /><o:p></o:p>
</handlers><o:p></o:p>
It's not an ASP.NET MVC application, is it?
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, May 10, 2009 12:34 AM -
User-1179262497 posted
Don't quite get it, this is what I have:
<handlers> <REMOVE class=st name=""WebServiceHandlerFactory-Integrated"> <REMOVE class=st name=""ScriptHandlerFactory"> <REMOVE class=st name=""ScriptHandlerFactoryAppServices"> <REMOVE class=st name=""ScriptResource"> <ADD class=st name=""WebPreviewHandler" verb="*" path="*.ashx" type="CoreApp.WebPreviewHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode"> <ADD class=st name=""ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <ADD class=st name=""ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <ADD class=st name=""ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> </HANDLERS>
Tuesday, May 12, 2009 1:08 AM