virtual file works in VS 2008, not IIS

Discussion in 'ASP .Net' started by David Thielen, Jun 4, 2009.

  1. 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@
    Windward Reports -- http://www.WindwardReports.com
    me -- http://dave.thielen.com

    Cubicle Wars - http://www.windwardreports.com/film.htm
    David Thielen, Jun 4, 2009
    #1
    1. Advertising

  2. 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:
    .

    ==================================================
    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.
    Allen Chen [MSFT], Jun 4, 2009
    #2
    1. Advertising

  3. 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 Thielen" <> wrote in message news:...
    > 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@
    > Windward Reports -- http://www.WindwardReports.com
    > me -- http://dave.thielen.com
    >
    > Cubicle Wars - http://www.windwardreports.com/film.htm
    Juan T. Llibre, Jun 4, 2009
    #3
  4. thank you - will try tomorrow.

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

    thanks - dave


    On Thu, 04 Jun 2009 01:52:32 GMT, (Allen
    Chen [MSFT]) wrote:

    >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:
    >.
    >
    >==================================================
    >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@
    Windward Reports -- http://www.WindwardReports.com
    me -- http://dave.thielen.com

    Cubicle Wars - http://www.windwardreports.com/film.htm
    David Thielen, Jun 4, 2009
    #4
  5. 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/
    =====================================================
    "David Thielen" <> wrote in message news:...
    > thank you - will try tomorrow.
    >
    > And why on earth did they go from something simple to such an
    > unbelieveable mess?
    >
    > thanks - dave
    >
    >
    > On Thu, 04 Jun 2009 01:52:32 GMT, (Allen
    > Chen [MSFT]) wrote:
    >
    >>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:
    >>.
    >>
    >>==================================================
    >>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@
    > Windward Reports -- http://www.WindwardReports.com
    > me -- http://dave.thielen.com
    >
    > Cubicle Wars - http://www.windwardreports.com/film.htm
    Juan T. Llibre, Jun 4, 2009
    #5
  6. 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
    Allen Chen [MSFT], Jun 4, 2009
    #6
  7. As it's just an httpHandler and no file actually exists, is R/W
    permission needed?

    thanks - dave


    On Wed, 3 Jun 2009 22:04:06 -0400, "Juan T. Llibre"
    <> wrote:

    >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 Thielen" <> wrote in message news:...
    >> 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@
    >> Windward Reports -- http://www.WindwardReports.com
    >> me -- http://dave.thielen.com
    >>
    >> Cubicle Wars - http://www.windwardreports.com/film.htm

    >
    >



    david@
    Windward Reports -- http://www.WindwardReports.com
    me -- http://dave.thielen.com

    Cubicle Wars - http://www.windwardreports.com/film.htm
    David Thielen, Jun 4, 2009
    #7
  8. Hi Dave,

    >thank you - will try tomorrow.


    Have you solved this issue?

    Regards,
    Allen Chen
    Microsoft Online Support
    Allen Chen [MSFT], Jun 10, 2009
    #8
  9. David Thielen, Jun 15, 2009
    #9
  10. David Thielen, Jun 15, 2009
    #10
  11. 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
    Allen Chen [MSFT], Jun 15, 2009
    #11
  12. Hi Dave,

    >Not yet - still trying different things.


    >thanks - dave


    Do you have any progress on this issue?

    Regards,
    Allen Chen
    Microsoft Online Support
    Allen Chen [MSFT], Jun 24, 2009
    #12
  13. David Thielen, Jun 25, 2009
    #13
  14. Hi Dave,

    >Still experimenting - the lack of any error messages is killer.


    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
    Allen Chen [MSFT], Jun 26, 2009
    #14
  15. Got it working!!! Your instructions were exactly right, we had 1 thing
    get dropped in communication between 3 people here.

    thanks - dave


    On Fri, 26 Jun 2009 01:23:53 GMT, (Allen
    Chen [MSFT]) wrote:

    >Hi Dave,
    >
    >>Still experimenting - the lack of any error messages is killer.

    >
    >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@
    Windward Reports -- http://www.WindwardReports.com
    me -- http://dave.thielen.com

    Cubicle Wars - http://www.windwardreports.com/film.htm
    David Thielen, Jun 29, 2009
    #15
  16. 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:
    .
    =================================================
    Allen Chen [MSFT], Jun 29, 2009
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden
    Replies:
    3
    Views:
    5,875
    Sherif ElMetainy
    Nov 7, 2003
  2. Marek G.

    IIS 7 , 2008 R2 and SQL 2008

    Marek G., Feb 23, 2010, in forum: ASP .Net
    Replies:
    2
    Views:
    942
    Marek
    Feb 24, 2010
  3. John Kennedy
    Replies:
    5
    Views:
    211
    Carl Prothman [MVP]
    Aug 14, 2003
  4. John Kennedy
    Replies:
    5
    Views:
    426
    Carl Prothman [MVP]
    Aug 14, 2003
  5. Elie Grouchko
    Replies:
    7
    Views:
    275
    Elie Grouchko
    Jan 4, 2005
Loading...

Share This Page