ASP.NET HTTP error 500.19 "cannot read config file"

4

I have a really frustrating problem. I have a website in ASP.NET. I use IIS Express for development. I recently moved my project files and folders from a usb drive to my dropbox folder to avoid carrying the drive around.

After moving my project to the dropbox folder, I got this error that IIS cannot read my config file. I noticed the path was pointing to my usb drive. So I copied my web.config to the path displayed in the error message and it worked again, if I delete it again, the error comes again.

So I think that somewhere in my project there is a config setting that points to my usb drive, although it should point to my local dropbox folder.

I have attached a screenshot of the error:

enter image description here

Translation:

Module IIS Web Core Message Unknown Handler still undetermined Error code 0x80070003 Config error The config file cannot be read Config file ......... Requested URL ........... Physical path Authentication method still unknown Authenticated user still unknown Debug path ..................

asp.net
web-config
asked on Stack Overflow Jul 4, 2013 by LeonidasFett • edited Nov 17, 2015 by pnuts

3 Answers

2

I had this problem when trying to launch a service from a project created on another machine that was saved in DropBox.

In the project folder there is a file in PROJECTFOLDERNAME/.vs/config/applicationhost.config

In that file is a list of sites in XML like so:

<sites>
    <site name="WebSite2" id="2">
        <application path="/" applicationPool="Clr4IntegratedAppPool">
            <virtualDirectory path="/" physicalPath="C:\Users\WRONGPATH\Dropbox\Website2\src\Website2" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:64655:localhost" />
        </bindings>
    </site>
    <site name="WebSite4" id="3">
        <application path="/" applicationPool="Clr4IntegratedAppPool">
            <virtualDirectory path="/" physicalPath="C:\Users\Nick\Dropbox\Website3\src\Website3" />
        </application>
        <bindings>
            <binding protocol="http" bindingInformation="*:64655:localhost" />
        </bindings>
    </site>
    <siteDefaults>
        <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
        <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
    </siteDefaults>
    <applicationDefaults applicationPool="Clr4IntegratedAppPool" />
    <virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>

Change the virtualDirectory physicalPath to the correct path. The problem I still face is I work on this project from two different locations, I don't really want to change this back and forth all the time.

answered on Stack Overflow Jan 26, 2017 by nick • edited Aug 3, 2017 by John
1

I had this issue when I moved my "My Documents" folder to another location. IIS Express was still pointing to old path. The only way I could fix this is by doing clean installation of IIS Express.

  • Uninstall IIS Express
  • Remove the 'IIS Express' folder that contains configuration file.
  • Install IIS Express
answered on Stack Overflow Feb 26, 2015 by Anwar Chandra
0

Uhh, I have looked for the answer for more than 2 hours. I tried cleaning up every bin, .vs folders. But those did not help me.

Eventually, I fixed the issue by re-showing (re-binding) the path to the project in IIS Manager

answered on Stack Overflow Jul 26, 2019 by Davronbek Rahmonov

User contributions licensed under CC BY-SA 3.0