Friday, May 6, 2011

How can I duplicate a website's settings in IIS7?

I'm going mad trying to get an ASP.NET application running on IIS7 (Server2008).

I have one web site set up in IIS7 which works fine. I'm trying to create another one now but I only get 404s for all .aspx files. The Handling Mappers are all different from the working site's. Is there any way I can duplicate the working site's settings so I don't have to go through 50 mappings manually.

Or is there a better way to get the correct settings?

From stackoverflow
  • For IIS 5 (and 6?), Microsoft had a free download called MetaEdit. It was used for just this - backing up and restoring an IIS configuration from machine to machine. Check MS's web site to see if there is an updated version for IIS 7.

  • If you are merely trying to re-install the default ASP.NET mappings, the best way to do that is use

    aspnet_regiis.exe
    

    which is in the %windir%\Microsoft.NET\Framework\v___ folders (depends on which version you're trying to set -- looks like 3.5?)

    Use the documentation at http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx to see whether you want to use the -i, -r, or -s option.

    Mr. Flibble : This didn't seem to make any changes. Everything is already setup as per aspnet_regiis.exe.
  • IIS7's default configurations are held in c:\windows\system32\inetsrv\config\applicationHost.config

    Any changes you make on a per site/application basis are stored in the web.config for that site/application.

    You should be able to simply copy the files onto the second server.

    Mr. Flibble : Copying the section from a working site to the new one made it work. Cheers.

0 comments:

Post a Comment