views:

732

answers:

4

Is it possible to debug an Asp.Net website running on iis? I am able to debug an Asp.Net web application project, but not a web site, and wanted to know if this is by design or am I missing something.

A: 

It works fine for me. You just copy the files over to the IIS folder, set IIS up and go. (If on the same machine). Make sure your project properties specify "Custom web server" and "http://localhost" (or whatever).

On Vista you need to be running Visual Studio as an Administrator.

If you're running your IIS on a different machine, you'll need to install the Remote Debugger which is on your Visual Studio disks and connect to hat by using Debug|Attach To Process in Visual Studio.

Program.X
it works find for web application but breakpoint does not stop for website
Yaron Naveh
+3  A: 

you can attached the asp_wp into your Visual Studio debuggar to debug it.

Bhaskar
it works find for web application but breakpoint does not stop for website
Yaron Naveh
@Yaron Naveh - you need pdb files near the dlls, also to leverage more debug features build your site in debug mode.
Dewfy
I'm using "website" not "web application". It does not compile locally but only on the fly in iis. How can I create the pdb?
Yaron Naveh
A: 

Could you clarify a bit more? Are you wanting to debug the site hosted on the server and step through the code locally in VS.NET?

Keith
my iis is on the local machine. I want to locally debug it. it works fine for web application but breakpoint does not stop for website.
Yaron Naveh
A: 

This should work:

  1. Compile project in Debug mode.
  2. Set debug="true" in the web.config.
  3. Attach to IIS working process (which v of IIS do you use?) (Ctrl-Alt-P in VS). There can be MANY processes. MAKE SURE YOU ATTACH TO THE CORRECT ONE.
Dmytrii Nagirniak
I use iis 5.There is only one process.I use website and not "web project" - it is compiled on the fly so I can't control it.
Yaron Naveh