LeonidasFett
LeonidasFett

Reputation: 3132

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

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

Upvotes: 4

Views: 3901

Answers (4)

Thierry Brémard
Thierry Brémard

Reputation: 899

solved my issue by updating virtual directory/advanced settings/LongonType = Batch (instead of network)

<virtualDirectory 
    path="/extractions" 
    physicalPath="\\data.myspector.com\data\ExecResults" 
    userName="MySpector.com\Admin" 
    password="[enc:IISCngProvider:2Wewwm4zL0+BeTbjR1dE/FM0i6g4GpoGt0IBHBfknBdklddXYYYBNbb3uDn0c6abzW8ZV1xGFu8TegyDNgmds7egqd54A==:enc]" 
    logonMethod="Batch"  <<<<<<<<<<<<<<<<<<<
    allowSubDirConfig="false" />
  • Also be aware in context of Apache to IIS migration on the side of the slashes in network folder: Apache uses / when physical path on IIS must be with '\'.

  • Also if you are internal to a company checkout the domain name and add a binding if not yet done (but this is not exactly for this precise error, but for a 404).

  • Last point to help you to trouble shoot : click on browse button inside IIS manager of server machine itself as web page will show you more detailed info that are hidden for security if you test from another machine.

Upvotes: 0

Davronbek Rahmonov
Davronbek Rahmonov

Reputation: 109

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

Upvotes: 4

nick
nick

Reputation: 507

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.

Upvotes: 2

Anwar Chandra
Anwar Chandra

Reputation: 8648

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

Upvotes: 1

Related Questions