IIS not able to locate the web.config

  • I have a deployed a web application in IIS. Which used to work without any issues. Recently i have shifted that web application to another machine, Here is the problem. Once i setup the Webapplication when i opened the default document in IIS im getting the File not found error as following

    Internal Server Error


    I have no clue why the IIS is not able to find the web.config. The file is present in the path C:\inetpub\wwwroot\application\web.config but the IIS is looking in the path \?\C:....

    Please let me know how to resolve this??

    Firstly this is documented on support.microsoft.com so I would suggest that anyone who has this issue read this first as it covers a number of solutions which I won't

    Now from personal experience I encountered this error after setting up a new development machine. What I had forgotten to do was install the Url Rewrite 2.0 IIS module. Sadly the IIS error gives absolutely no idea that this is the actually issue.

    Therefore to solve this issue investigate the system.webServer setting in our web.config and ensure that you have installed all the iis modules that you use. I did this by systematically removing elements from my web.config until I came across the cause.

    I know it's old post but I resolved the same issue as follows:

    If you are using TFS and you are getting this problem then Reason is ".vs" file is not excluded from commit.

    Because of that ".vs\config\applicationhost.config" gets the local version of another user/Developer.

    To Solve the error, First open that file Update Physical path inside "" xml tag.

    Also ask user to exclude this folder from TFS to prevent future issues.


Log in to reply