virtual file works in VS 2008, not IIS

  • Thread starter Thread starter David Thielen
  • Start date Start date
D

David Thielen

Hi;

I create avitars in a program Avitar.cs. Works great in VS 2008, not
in IIS. In IIS https://www.windwardreports.com/apps/avitar-6097.png
returns an error 404

In VS2008 http://localhost:2716/store/avitar-6097.png works fine.

In VS 2008 I have:
<httpHandlers>
<add verb="*" path="avitar-*.*" type="Avitar"/>
</httpHandlers>

In IIS I have tried both
<httpHandlers>
<add verb="*" path="avitar-*.*" type="Avitar"/>
</httpHandlers>

and
<httpHandlers>
<add verb="*" path="apps/avitar-*.*" type="Avitar"/>
</httpHandlers>

But neither works. I know it's something simple but I can't figure it
out.

help - thanks - dave


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Hi Dave,
I create avitars in a program Avitar.cs. Works great in VS 2008, not
in IIS. In IIS https://www.windwardreports.com/apps/avitar-6097.png
returns an error 404


For IIS 7 please add the handler in the following position of web.config:

<system.webServer>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />

<!--Register your handler here, and speicify a name for it, for instance,
<add name="MyHttpHandler" verb="*" path="*.*" type="LogComponent.MyHandler"
/>-->


<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>
</system.webServer>

After publishing you can check the Handler Mappings of this site in IIS.
The handler you registered should appear there. If not you can manually
register it by click "Add Managed Handler" in the actions panel.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
re:
!> neither works

You have a permissions problem.

You need to check which account ASP.NET is running as.

When you use the ASP.NET Development server in VS 2008,
ASP.NET runs as the machine\Administrator account.

When you use IIS, ASP.NET runs as a different account.

Under Windows Server 2003, that account usually is Network Service.
It may be different when IIS runs under a different OS.

Save this code as "identity.aspx" and run it in IIS :

<%@ Page Language="VB" %>
<html>
<head>
</head>
<body>
<%
Response.Write("ASP.NET is running as the account : " & Environment.Username)
%>
</body>
</html>

Running that file will tell you which account needs read/write
permissions when you run your Avatar app under IIS.




Juan T. Llibre, asp.net MVP
¿ Estas probando VS 2010 y ASP.NET 4.0 ?
Regístrate (gratis) en los Foros de VS 2010 y ASP.NET 4.0, en español
http://asp.net.do/foros/forums/
=====================================================
 
thank you - will try tomorrow.

And why on earth did they go from something simple to such an
unbelieveable mess?

thanks - dave


Hi Dave,



For IIS 7 please add the handler in the following position of web.config:

<system.webServer>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />

<!--Register your handler here, and speicify a name for it, for instance,
<add name="MyHttpHandler" verb="*" path="*.*" type="LogComponent.MyHandler"
/>-->


<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>
</system.webServer>

After publishing you can check the Handler Mappings of this site in IIS.
The handler you registered should appear there. If not you can manually
register it by click "Add Managed Handler" in the actions panel.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Don't forget to do the simple "which account needs permissions" test code I posted.




Juan T. Llibre, asp.net MVP
¿ Estas probando VS 2010 y ASP.NET 4.0 ?
Regístrate (gratis) en los Foros de VS 2010 y ASP.NET 4.0, en español
http://asp.net.do/foros/forums/
=====================================================
 
Hi Dave,
And why on earth did they go from something simple to such an
unbelieveable mess?

IIS 7 supports both classic mode and integrated mode. Therefore the ways to
register HttpHandler are different for these two modes. (and different with
IIS 6)

You can refer to this documentation to learn how to register HttpHandler:

http://msdn.microsoft.com/en-us/library/46c5ddfy.aspx

Regards,
Allen Chen
Microsoft Online Support
 
As it's just an httpHandler and no file actually exists, is R/W
permission needed?

thanks - dave


re:
!> neither works

You have a permissions problem.

You need to check which account ASP.NET is running as.

When you use the ASP.NET Development server in VS 2008,
ASP.NET runs as the machine\Administrator account.

When you use IIS, ASP.NET runs as a different account.

Under Windows Server 2003, that account usually is Network Service.
It may be different when IIS runs under a different OS.

Save this code as "identity.aspx" and run it in IIS :

<%@ Page Language="VB" %>
<html>
<head>
</head>
<body>
<%
Response.Write("ASP.NET is running as the account : " & Environment.Username)
%>
</body>
</html>

Running that file will tell you which account needs read/write
permissions when you run your Avatar app under IIS.




Juan T. Llibre, asp.net MVP
¿ Estas probando VS 2010 y ASP.NET 4.0 ?
Regístrate (gratis) en los Foros de VS 2010 y ASP.NET 4.0, en español
http://asp.net.do/foros/forums/
=====================================================


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Hi David,
Not yet - still trying different things.
thanks - dave

Please keep me updated if you've solved this issue or need further
assistance on it. I'll do my best to follow up.

Regards,
Allen Chen
Microsoft Online Support
 
Got it working!!! Your instructions were exactly right, we had 1 thing
get dropped in communication between 3 people here.

thanks - dave


Hi Dave,


Do you mean after registering the handler in <system.webServer> you still
get 404 error?

Could you try the following way to add the handler? It's another option
that uses IIS UI to add managed handler. Can it work?

http://learn.iis.net/page.aspx/366/developing-iis-70-modules-and-handlers-wi
th-the-net-framework/


Regards,
Allen Chen
Microsoft Online Support


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
Glad to know that :)

Thank you for using our Newsgroup Support Service!

Regards,
Allen Chen
Microsoft Online Community Support


=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
=================================================
 
Back
Top