Yaron Naveh
Yaron Naveh

Reputation: 24396

Asp.Net: Debug website in iis

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.

Upvotes: 11

Views: 22465

Answers (4)

David
David

Reputation: 3355

Had this same problem. The key is to not open the project using the visual studio project file.

  1. In IIS, under your Default Web Site, you need to have already created an application, and pointed it at the folder containing the files.
  2. In Visual Studio, go to File > Open > Web Site (Shift+Alt+O).
  3. Select the newly-created application.
  4. You'll notice the solution explorer now uses the URL in place of the project name. (http://localhost/mysite/)
  5. Click the debug arrow like normal.

Upvotes: 17

Dmytrii Nagirniak
Dmytrii Nagirniak

Reputation: 24078

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.

Upvotes: 3

Bhaskar
Bhaskar

Reputation: 10681

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

Upvotes: 4

Program.X
Program.X

Reputation: 7412

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.

Upvotes: 1

Related Questions