IIS7: Possible causes of 'Unrecognized configuration path' error

拜拜、爱过 提交于 2019-12-04 23:34:46

I found I'd gotten this same error after making a few changes to the site configuration of my applicationhost.config file. After looking more closely and comparing some sites which were working correctly against other sites which weren't working correctly, I noticed that I had apparently whacked the parent application configuration for a few of my sites.

Here's an example of the site configuration when I was getting the "Unrecognized configuration path" 500.19 error:

<site name="Peanuts-Site" id="2345">
    <application path="/peanuts" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\websites\Peanuts" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:80:localhost" />
    </bindings>
</site>

And here's what it looked like after I restored the deleted parent application:

<site name="Peanuts-Site" id="2345">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\Users\firstname.lastname\Documents\My Web Sites\Peanuts-Site" />
    </application>
    <application path="/peanuts" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="C:\websites\Peanuts" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:80:localhost" />
    </bindings>
</site>

Unbeknownst to me at the time, IIS Express seems to require a an application to be defined that's mapped to the site root when specifying any application not mapped to the site root. And on second thought, this requirement actually does make sense after all.

Lesson learned -- Don't go on an overzealous pruning spree unless you know what you're doing. I'm just glad I remembered what I did so I could fix it later.

I had an error like this when using IISExpres 7.5 as a development webserver:

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information:

Module : IIS Web Core

Notification : Unknown

Handler : Not yet determined

Error Code : 0x80070002

Config Error : Unrecognized configuration path 'MACHINE/WEBROOT/APPHOST/.....'

Steps to fix:

  • open "%userprofile%\My Documents\IISExpress\config\applicationhost.config."
  • remove all system.applicationHost/sites/site nodes and save file.
  • go to properties page of web project ( in VS2010 ), then web -> servers.
  • check "use IIS Express"
  • set project url: (e.g. http://localhost:54230/my-web-site )
  • click "Create Virtual Directory"

it should now be working again.

The root cause for me was that i tried to remove a parent app of the project url. It was first configured as http://localhost:54230/, and then I changed it to http://localhost:54230/my-web-site

This introduced configuration errors somewhat like these

Removing the parent app broke the chain of the configuration path.

This happened to us after we cloned a GIT bare repository (located in a folder on our server) in a newly configured machine.

We tried the steps given by @RemcoSchoeman with no success. When we deleted the .vs folder from the project's root folder, it started to work again.

I got the same error but then I managed to get the website working by removing it completely from IIS and adding it again, with a different name.

But I still don't know what was in the background.

I found out it depended on the length of the name of the website. Making the name shorter made it work (making it longer made it crash).


I was using IIS Express and i got the same error.
What i did , I move the applicationhost.config file from Documents\IISExpress\config to another place, and then run iisexpress from command prompt.
It worked for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!