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

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).

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.


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.