IIS 7.5 saving configuration settings to web.config with IIS Manager

iis-7.5

I installed IIS 7.5 (Windows 7) on two different PCs, one PC saves configuration to applicationHost.config and the other to web.config! Screenshot:

Configuration location differences

As you can see, the PC on the left does not contain the settings (they are stored in applicationHost.config) and the PC to the right does in fact store the settings in web.config.

I have not and hope not to modify the configuration files by hand and would like to do it using IIS Manager only.

Does anyone know why this happens or if there is some setting to force configuration to the web.config file? Thank you.

Edit: I am adding a screenshot of the applicationHost.config file (PC on the left) demonstrating how the configuration is stored in it instead of inside the web.config file.

enter image description here

Edit: Here are the steps that I am taking and I do make sure to work at the site level as suggested by Chris (having the site selected):

  1. Create folder named junk.tst using Windows Explorer.
  2. Copy all files and subfolders except for web.config from crop.tst (a working website) into junk.tst. Except for web.config, directory structures are identical.
  3. Launch IIS Manager, click on ‘Sites’ then ‘Add web site’. Provide basic settings for website ‘junk.tst’. Use existing ‘classic’ application pool.
  4. Clicking on site ‘junk.tst’, create bindings for ‘www.junk.tst’ and ‘junk.tst’.
  5. Double click on ‘junk.tst’ so that the IIS icons are visible. Please note that the site ‘junk.tst’ is selected on the left hand column tree view.
  6. Double click on the ‘Default Document’ icon and provide it (get rid of the other default docs).
  7. Go back to the IIS icons. ‘junk.tst’ is still selected on left.
  8. Double click on ‘Handler Mappings’ and ‘Add script map’ for my *.srf and another script map for my dll.
  9. Site ‘www.junk.tst’ is now working and handles requests made to *.srf and *.dll

Now I inspect web.config and like above, the circled config is not stored within web.config

Best Answer

When you add the handlers, where are you doing it? Modifying at the site level will put them in web.config. Modifying them at the IIS level will put them in to applicationhost.config. My guess is that you edited them at the site level one one machine and IIS level on the other.

If these handlers are part of the site config then you should just copy the web.config along with the rest of the site - no need to add the configuration manually after deploying the site, IIS will pick the settings up from the web.config.

Related Topic