IIS Express - 500.19 Cannot read configuration file - because it's looking at the wrong path

Solution 1:

Here is another possible solution that doesn't involve fishing for the applicationhost.config file:

  • Right click Web Project > Web > Project Url > (e.g. 'localhost:5459') and then increment the port number which will force a new entry in that file.

In my case I also needed to change authentication mode which can be done via:

  • Select Web Project > press F4 > set Windows Authentication as needed (enabled in my case).

Solution 2:

Turns out I had to edit %USERPROFILE%\Documents\IISExpress\config\applicationhost.config in the following way -

<configuration>
  <system.applicationHost>
    <sites>
      <site name="wsBusinessLayer">
        <application path="/">
           <virtualDirectory path="/Flowers" physicalPath="D:\TFS\sys\companydomain.com\Dev\Flowers" />

I don't know how this file gets changed "properly", but editing it manually worked fine.

Solution 3:

In my case, the wrong path was recorded in a .vs folder in the zip i received from colleague. Normally, I'd get source through source repository where .vs is not checked in.

Deleting the .vs folder resolved the problem for me.

Solution 4:

In my case, the following changes resolved this error:

Open applicationhost.config file from [SolutionFolder]>.vs[Hidden Folder] and change the value of overrideModeDefault attribute in windowsAuthentication section from Deny to Allow. As shown below.