Background
If you have a bunch of legacy ASP.NET web projects running on .NET Framework, not .NET Core, you might end up with this error:
[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: site]
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +298[HttpException (0x80004005): Specified argument was out of the range of valid values.
Parameter name: site]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
The key hint on what the problem is, is Parameter name: site. You might get this out of nowhere if you install Windows 10’s Fall Creator’s Update. You can also get it in Windows 8. It all comes down to the IIS Express configuration and dependencies.
Here’s a nice image for the record:
I’m blogging this because we will need it in future in our team.
Solution
There’s several ways to fix it, but the easiest and least-interfering way is to install the “Internet Information Services Hostable Web Core” Windows feature:
Simple as that 🙂 You don’t need to install the full-blown IIS feature (unless you want it!).
Hope this helps!