Daily Archives: 19 February 2014

Determine the ID for a Site in IIS

IIS sites have an ID. There are a couple of ways for determining the ID of a site.

Using the IIS Manager

Open the IIS Manager and click on the site that you are interested in.
In the Actions column on the far right, click the Advanced Settings link (at the bottom in the screen shot):

Advanced Settings

Then, in the dialog which opens, the ID will be visible:

Site ID

From the ApplicationHost.config File

The sites element in the ApplicationHost.config files contain site elements, each of which has an id attribute. That is what you need to look for.

The ApplicationHost.config can be located in either of these places (depending on which web server the site is on, Express or normal):

  1. C:\Documents\[UserName]\Documents\IISExpress\config (for IIS Express)
  2. C:\Windows\System32\inetsrv\config (for IIS)

The Breakpoint will not Currently Be Hit

There are few things more frustrating than your breakpoints not being hit. In such cases, I’m sure you’ve all seen the following message when hovering over the breakpoint being missed:

The breakpoint will not currently be hit. No symbols have been loaded for this document.

The way that I like to resolve that (which has worked from me more often than not) is to find the pdb file which is actually loading the symbols and deleting it. Usually, that file is stale and by deleting it, you’re forcing the Build to create a new pdb file which will contain your fresh code.

Here are the steps involved.

  1. start debugging a project (press F5)
  2. go to the Debug menu, click the Windows submenu and select Modules (only visible when debugging, hence step 1)
    Modules
  3. identify the DLL you are interested in and copy the path to the folder containing the symbol file (pdb) into the address bar of Windows Explorer
    PathToPdb

Then it’s up to you whether you just delete the single file, the folder containing it, or more. As it is a shadow copy, there is no harm in deleting the whole folder. In fact, I usually go several directories above that directory and delete that directory tree:
Shadow