Previous Next

Thread: Visual Studio "F5" debugging does not work for Integrated mode ASP.NET applications

Last post 12-29-2006 7:35 PM by mvolo. 3 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (4 items)

Sort Posts:

  • 06-14-2006, 11:11 AM

    • mvolo
    • Top 10 Contributor
    • Joined on 09-17-2003, 1:48 PM
    • Philadelphia, PA
    • Posts 583
    • mvolo

    Visual Studio "F5" debugging does not work for Integrated mode ASP.NET applications

    There is an issue preventing the Visual Studio automatic "F5" debugging from working by default for ASP.NET applications.

    When attempting to debug, you will see an error like this:

    <<

    Unable to cast object of type 'System.Web.HttpDebugHandler' to type 'System.Web.HttpApplication'.

    ------------------------------------------------

    Unable to start debugging on the web server.

     [InvalidCastException]: Unable to cast object of type 'System.Web.HttpDebugHandler' to type 'System.Web.HttpApplication'.

       at System.Web.Hosting.PipelineRuntime.ExecuteStateHandler(IntPtr& managedRequestContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
    >>

    The workaround is to attach directly in Visual Studio.  Open Visual Studio, go to Tools > Attach to Process, find the wp.exe process running your application, select and click Attach.

    Another possible workaround is to move the application to ISAPI mode, by moving it to the "Classic .NET AppPool" or another application pool running in ISAPI mode, or by making the application pool within which this application runs to use ISAPI mode in configuration.

    This issue has been fixed in post-beta2 builds but unfortunately the fix did not make it to beta2.

    Thanks,

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 09-20-2006, 7:08 PM In reply to

    • wph101larrya
    • Top 500 Contributor
    • Joined on 06-29-2005, 7:48 PM
    • Tallahassee Florida
    • Posts 9
    • wph101larrya

    Re: Visual Studio "F5" debugging does not work for Integrated mode ASP.NET applications

    I believe that you are in error in the "issue has been fixed in post-beta2 builds ". I am running RC1 and have not been able to get the debugger to run as it did in Server 2003.  Worse, VS crashes so much its not even funny.  The July CTP from my perspective was much more stable than RC1 is.

    So if you have information that we don't, sure would be nice if you would share it.

    Larry

  • 10-08-2006, 3:22 PM In reply to

    • mvolo
    • Top 10 Contributor
    • Joined on 09-17-2003, 1:48 PM
    • Philadelphia, PA
    • Posts 583
    • mvolo

    Re: Visual Studio "F5" debugging does not work for Integrated mode ASP.NET applications

    Larry, sorry for the late reply.  The ASP.NET runtime issue I am referring to here has indeed been fixed for RC1.  However, due to a number of changes in Vista security and IIS7, it currently takes a few extra steps to get VS debugging working.

    These are documented here: http://blogs.msdn.com/webdevtools/archive/2006/09/18/761206.aspx.

    If you follow these steps and it still doesnt work for you, let us know what issues you are having so that we can get to the bottom of it. 

    Thanks,

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 12-29-2006, 7:35 PM In reply to

    • mvolo
    • Top 10 Contributor
    • Joined on 09-17-2003, 1:48 PM
    • Philadelphia, PA
    • Posts 583
    • mvolo

    Re: Visual Studio "F5" debugging does not work for Integrated mode ASP.NET applications

    For a complete walk-through of how to enable Visual Studio 2005 F5 debugging for ASP.NET applications running on IIS7 / Vista, check out this post: http://mvolo.com/blogs/serverside/archive/2006/12/28/Fix-problems-with-Visual-Studio-F5-debugging-of-ASP.NET-applications-on-IIS7-Vista.aspx.

    Thanks,
    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (4 items)
Page view counter