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

I recently renamed my TFS root folder from D:\TFS\systemstfs to D:\TFS\sys , because one of the project paths was too long for Windows. Now when I try to start another project (D: \ TFS \ sys \ companydomain.com \ Dev \ Flowers \ wsBusinessLayer) in VS2013 using IIS Express (project URL http: // localhost: 59729 / Flowers / wsBusinessLayer / ) in the browser The following error message appears:

HTTP Error 500.19 - Internal Server Error
The requested page is not available because the corresponding configuration data for the page is invalid.

Module - IIS Web Core
Notification - BeginRequest
The error code is 0x80070003
Configuration Error - Unable to read configuration file
The configuration file is \? \ D: \ TFS \ systemstfs \ companydomain.com \ Dev \ Flowers \ web.config
The requested URL is http: // localhost: 59729 / Flowers / wsBusinessLayer / InformationServices.asmx
Physical path - D: \ TFS \ sys \ companydomain.com \ Dev \ Flowers \ wsBusinessLayer \ InformationServices.asmx

(focus, D: this is the second hard drive on my machine, not a network resource)

It’s clear to me what the problem is (the path to the configuration file is wrong), but I have no idea how to fix it. I tried:

  • Enabling "throw CLR exception interrupt"
  • Retrieving Solution from TFS
  • Rebooting
  • Switch to use IIS and then back to Express
  • Googling 500.19, 0x80070003, wrong path, cannot read configuration file and various combinations of these terms

But no luck. Has anyone come across this before?

+60
iis-express
Oct 22 '15 at 8:47
source share
12 answers

Turns out I had to edit %USERPROFILE%\Documents\IISExpress\config\applicationhost.config as follows:

 <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 changes “correctly”, but manually editing it works fine.

+27
Oct 22 '15 at 9:59
source share

Here is another possible solution that does not include a trap for the applicationhost.config file :

  • Right-click web project> Internet> project URL (for example, "localhost: 5459"), and then increase the port number that will force a new entry in this file.

In my case, I also needed to change the authentication mode, which can be done with:

  • Select a web project> press F4> install for Windows authentication (enabled in my case).
+90
Aug 04 '16 at 23:44
source share

In my case, the following changes resolved this error:

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

+14
Nov 02 '16 at 1:50
source share

In my case, the wrong path was recorded in the .vs folder in the zip archive that I received from a colleague. I usually get the source code through a repository where .vs is not registered.

Removing the .vs folder solved the problem for me.

+10
Jan 25 '18 at 9:40
source share

Changing the port number in my MVC project resolved my problem. I went for more than an hour looking for an answer. Thanks, Sonic Soul.

It always amazes me when one tiny trick can fix something terribly broken.

I increased the port number and fixed the error.

 Project Properties > Web > Project Url 

Using Visual Studios 2015.

+9
Dec 06 '16 at 19:11
source share

If you are using the local IIS web server, rename your own virtual directory, save and try again. After that you can return the original name.

+1
Jun 09 '17 at 23:43 on
source share

In my case, I got a new machine, but when I tried to run the source code (which is copied from the old machine), I got this error. Removing the applicationhost.config file from the .vs \ config folder in the source directory solved the problem.

+1
Mar 29 '18 at 19:57
source share

I got the same error in IIS 8.5 (not express)

For me, this was because I replaced the folder with a copy and renamed it while IIS was running. For some reason he staggered. I had to remove the website definition from IIS and add it to make it work.

0
May 14 '17 at 10:39
source share

There was the same problem today.

Change that caused the problem

Transferring functionality from a separate controller to a home controller. I literally moved the view and functionality behind it from Controller'X ' to the HomeController

Nature of the issue

  1. Everything works fine when running through IIS Express / Visual Studio
  2. Everything works fine when deployed locally in IIS.
  3. Hell falls apart when deployed on a deployment machine.
  4. It works fine if I deploy to the “new site” in the IIS deployment machine.

correct

  1. remove the site / application pool instance from IIS.
  2. Recreate them.
  3. Deployment.
0
Apr 11 '18 at 1:41
source share

In my case, I replace .. in my path with the usual folder path.

TL DR

I did a smart trick using the relative path to my script file, since I did not want to hardcode the address of my folder.

 "C:\Program Files\IIS Express\iisexpress.exe" /path:"%~dp0..\Lagardsdorren\bin\Debug\netcoreapp2.2\publish" /port:44342 

I knew, but it took me a while to realize that .. in IIS (express) non grata, because it allows you to find the path from the home directory of your site. In my case, this is not the case, but I think IIS (express) just stops anything with .. in it.

I do not know how to return to my smart relative path, but this is another question.

0
Dec 22 '18 at 21:48
source share

If you use a virtual machine with "Shared Folders" - I used Workstation Pro to share the folder. When the project was in the "Shared Folder", which was placed on the HOST PC, I could not start the project. Moving the project to the "Local" drive has been resolved for me.

0
Aug 21 '19 at 20:00
source share

I solved this by going to the project properties> Web> and clicking "Create a virtual directory", and I did not have to change the ports.

0
Aug 22 '19 at 17:12
source share



All Articles