views:

681

answers:

2

Hello everyone,

I am using VSTS 2008 + .Net + C#. I am developing an ASP.Net web application. I have added an generic handler, i.e. .ashx file. How to debug this ashx file in VSTS 2008? I find there is no view in browser or set as startup page option. Any ideas?

thanks in advance, George

+3  A: 

You can simply attach your studio to your IIS webserver (Debug -> Attach to Process -> w3wp.exe).

Josef
You mean deploy the web application into IIS, when attach to w3wp and set break point into ashx file?
George2
That is exactly what I mean.
Josef
I have stopped app pool and start app pool, but no w3wp process running... how to attach? Or should I attach to some other process name?
George2
you have to call it first before it spins the process
Grzenio
and the process will be called aspnet_wp.exe on IIS 5.1 (Win XP)
Grzenio
Thanks Grzenio, I am using Windows Sever 2003 + IIS 6.0. Which is the correct process name to attach?
George2
@Grzenio, "you have to call it first before it spins the pro" -- in my application design, a method is called only for the 1st request, and I need to debug that 1st request handle method, and if I send a request and debug from the second request, I will miss the specific method, any comments or ideas?
George2
+2  A: 

If your project is a Web Service project (or similar name - the icon would have a globe with a document and C#), you can just run this project from VS. VS will run the built in ASP .Net Development Server, and open IExplorer with links to all the files. (at least that what it does for me)

Grzenio
Sorry my project is not web services project. When I press F5 to debug in VSTS2008 there is error saying cannot find default.aspx file. I am developing an ASP.Net application and I deleted the default.aspx and I only need a generic handler ashx file in my requirements. Any ideas to debug the ashx file? The ashx file is the only file in my Web Application, besides other utility C# classes.
George2