Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS not able to locate the web.config

Tags:

iis

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

\?\C:\inetpub\wwwroot\application\web.config

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??

like image 796
Umamaheswaran Avatar asked Aug 02 '12 13:08

Umamaheswaran


3 Answers

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.

like image 152
Alistair Avatar answered Sep 28 '22 09:09

Alistair


In my case, I was running ASP .NET Core website so I had to install .Net Core Runtime from https://dotnet.microsoft.com/download/dotnet-core/current/runtime

like image 43
Hardik Patel Avatar answered Sep 28 '22 09:09

Hardik Patel


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.

like image 24
ParthKansara Avatar answered Sep 28 '22 08:09

ParthKansara