IIS 7: value does not fall within the expected range

I was experiencing the same problem. And the problem was with the file pointed out by @aaron-gibson.

applicationHost.config at: C:\Windows\System32\inetsrv\config

(see here: IIS Configuration Reference)

One of the site had incorrect data:

<application path="/e:\MyFolder\MySiteWithProblem\VDir" applicationPool="AppPool152">
<virtualDirectory path="/" physicalPath="e:\MyFolder\MySiteWithProblem\VDir\Vdir" />

The application path in this case had invalid characters. And also, the physicalPath didn't exist.

Fixing this entry fixed the problem.

The answer marked as the solution fixed the problem because it recreated this file from scratch. But in my case I did not lose all my sites.

I changed the file applicationHost.config at: C:\Windows\System32\inetsrv\config

And the entries for each site are in the tags:

<configuration> <system.applicationHost> <sites> ... <site name="Default Web Site" id="1" serverAutoStart="true"> <application path="/MyPath" applicationPool="AppPool152"> <virtualDirectory path="/" physicalPath="e:\MyFolder\MySite\Vdir" /> </application> ... <site> ... </sites> </system.applicationHost> </configuration>


I had this issue in IIS 8.5, the problem ended up being an incomplete entry for the host name in the bindings. I didn't include .com on the FQDN.


I have found that, this issue was coming due to incorrect virtual directory was created by visual studio in IIS due to which default web site was unable to start.

What I'd done to resolve this, I'd deleted my Default Web Site and created again in IIS. After that I'd created my application's specific virtual directories. This resolve my problem. Still not know why default web site stop working after incorrect virtual directory created by Visual Studio.

Hope this helps for those who are facing this issue.


I have this issue with setting specific accounts for the site to run as..

It goes away if you set the password in the applicationHost.config directly. Cannot do it though IIS anymore though..

In: C:\Windows\System32\inetsrv\config

May help.