Asp.Net: Debug website in iis

18,517

Solution 1

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.

Solution 2

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

Solution 3

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.
Share:
18,517
Yaron Naveh
Author by

Yaron Naveh

Web Services Performance, Interoperability And Testing Blog - WCF, Axis2, WSIT... blog twitter

Updated on July 24, 2022

Comments

  • Yaron Naveh
    Yaron Naveh almost 2 years

    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.

  • Yaron Naveh
    Yaron Naveh almost 15 years
    it works find for web application but breakpoint does not stop for website
  • Yaron Naveh
    Yaron Naveh almost 15 years
    it works find for web application but breakpoint does not stop for website
  • Dewfy
    Dewfy almost 15 years
    @Yaron Naveh - you need pdb files near the dlls, also to leverage more debug features build your site in debug mode.
  • Yaron Naveh
    Yaron Naveh almost 15 years
    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
    Yaron Naveh almost 15 years
    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.
  • AbdulG
    AbdulG almost 4 years
    So much of the same answers over the internet. This is the only 1 I have been looking for