260

I am getting this Kind of Error like::

Specified argument was out of the range of valid values.Parameter name: site

while Debugging any of my Project.

I have also tried after Reinstalling My Visual Studio 2012. But again the same kind of problem I am getting while Debugging.

My System's Configurations are :

  • Windows 8 : 32-bit
  • Visual Studio : 2012

Exception is thrown at the time of Showing Web Page Like,

[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
8
  • where this exception is thrown? Jul 21, 2013 at 12:20
  • 1
    Exception is thrown while showing the Web Page after Debugging.
    – Rahul_RJ
    Jul 21, 2013 at 12:29
  • Not clear post some code which line this exception is thrown Jul 21, 2013 at 12:31
  • Now see I have also Given the Error shown while showing the Web Page
    – Rahul_RJ
    Jul 21, 2013 at 12:34
  • @Rahul_RJ You are not helping. You are showing the stack trace where it says the location of the exception but not including that code. Jul 21, 2013 at 12:42

12 Answers 12

533

If using IIS:

  • control panel
  • Programs
  • open or close windows features
  • tick internet information services
  • then restart your visual studio

If using IIS Express:

Open 'Add/Remove Programs' from the old control panel and run a repair on IIS Express Or you might go Control Panel ->> Programs ->> Programs and Features ->> Turn Windows features on or off ->> Internet Information Services and check the checkbox as shown in the picture below:

enter image description here

31
  • 41
    After a Windows-update this issue got me. Solution still works today! Windows 10 Pro Insider Preview Build 16199.rs_prerelease.170513-2252 May 18, 2017 at 8:22
  • 21
    You don't need all of IIS, you can just install IIS Management Console (IIS --> Web Management Tools --> IIS Management Console).
    – jpda
    May 19, 2017 at 15:28
  • 11
    I also received this error after updating to 'Windows 10 Pro Insider Preview Build 16199.rs_prerelease.170513-2252'. Added 'IIS Management Console' as recommended by JPD. Problem solved.
    – BobK
    May 25, 2017 at 22:16
  • 14
    Got the error with the Win10 Fall creators update, installing only the "Hostable Web Core" did the trick. Thanks ;)
    – LucasMetal
    Oct 18, 2017 at 22:00
  • 41
    4 years later and the answer still holds up. Windows 10 Update installed and IIS went away. Seriously, WTF MS... Nov 2, 2017 at 1:23
166

This occurred to me when I applied the 2017 Fall Creator Update. I was able to resolve by repairing IIS 10.0 Express (I do not have IIS installed on my box.)

Note: As a user pointed out in the comments,

Repair can be found in "Programs and Features" - the "classic" control panel.

10
  • 45
    Repair can be found in "Programs and Features" - the "classic" control panel. Oct 22, 2017 at 4:13
  • 4
    Same here! Repairing IIS 10.0 Express fixed. Thanks! Oct 22, 2017 at 8:16
  • 4
    This is the solution for IIS Express, works as explained. Since we cannot have two official answers, I have added this to the official answer. Oct 25, 2017 at 20:10
  • 1
    Repairing IIS Express would crash the installer for me. I had to uninstall/re-install IIS Express using the Visual Studio 2017 installer under the individual components section. It will tell you other components need to be uninstalled as well. Make note of them and and then proceed with uninstall/re-install of the components.
    – Thomas927
    Oct 26, 2017 at 15:03
  • 3
    I ended up downloading the stand-alone installer for IIS 10.0 Express and doing the uninstall/re-install using that instead of letting the VS installer removed the other things. Everything seems to be working out so far. Nov 8, 2017 at 21:23
37

I had the same issue i resolved it by repairing the iis server in programs and features.

GO TO

Controll panel > uninstall a program and then right click the installed iis express server (installed with Visual Studio) and then click repair.

this is how i solved this issue

0
36

I had the same issue with VS2017. Following solved the issue.

  1. Run Command prompt as Administrator.
  2. Write following two commands which will update your registry.

reg add HKLM\Software\WOW6432Node\Microsoft\InetStp /v MajorVersion /t REG_DWORD /d 10 /f

reg add HKLM\Software\Microsoft\InetStp /v MajorVersion /t REG_DWORD /d 10 /f

This should solve your problem. Refer to this link for more details.

3
  • 2
    This solution worked for me when I was blocked by a grayed out Modify button in Control Panel add/remove programs.
    – camelCase
    Nov 17, 2017 at 14:30
  • 1
    you the man, microsoft fcked up with its falls creator update sht, you fixed it. you worth more than the entire company
    – kexx
    Feb 9, 2018 at 18:27
  • 1
    This fixed it for me - vanilla install of Visual Studio 2019 in Windows Server 2019. Didn't need a reboot. Oct 7, 2019 at 18:40
12

Instead of installing the bloated IIS, I get mine resolved by installing Internet Information Services Hostable Web Core from the Windows Features

4
  • You don't have to install all of IIS - just tick the box and take the defaults. Making sure that's clear :) Jul 15, 2017 at 17:41
  • Got the error with the Win10 Fall creators update, installing only the "Hostable Web Core" did the trick. Thanks ;)
    – LucasMetal
    Oct 18, 2017 at 22:01
  • I can confirm also that following the Win10 Fall creators update, the above suggested solution of installing the Hostable Web core component did the trick. To do this click on the Microsoft Windows button, then type Turn Windows Features ON or OFF in the search box, then select Internet Information Services Hostable Web Core. Oct 29, 2017 at 11:40
  • Best Solution. Worked for me like a charm.
    – vibs2006
    Aug 12, 2019 at 9:10
7

When you start with a Specific Page while debugging your project, and you are using Local IIS, you might have filled a wrong value in the Specific Page textbox.

(via Project Properties > Web > Start Action > Specific Page)

Wrong configuration:

Specific Page: "http://localhost/MyApplication/Start/SpecificPage.aspx"
Project Url: "http://localhost/MyApplication"

Right configuration:

Specific Page: "/Start/SpecificPage.aspx"
Project Url: "http://localhost/MyApplication"

Note: Ignore the quotation marks.

3

If you are okay with using the built in Visual Studio Development server or you don't want to or cannot install IIS, you can change the web server the project uses by going into

  1. Project Properties (right click project in solution explorer and select properties)

  2. select Web tab

  3. select "Use Visual Studio Development Server".

I don't know how it happened to me, but somehow this option was changed to "Use Local IIS Web Server" for one of my projects.

1

This resolved the issue on Windows 10 after the last update

go Control Panel ->> Programs ->> Programs and Features ->> Turn Windows features on or off ->> Internet Information Services

But based on previous response it doesn't work unless checking all these options as on pic below

enter image description here

0

For me, it was happening because I had switched over to "Run as Administrator". Just one instance of VS was running, but running it as admin threw this error. Switching back fixed me right up.

0

Modify was greyed out for me, but adding the IIS Management Console under programs and features fixed this for me. Also on Windows 10 fall update.

0

I got this issue when trying to run a project targeting Framework 4.5 in VS2017. After changing it to Framework 4.6.X it got fixed by itself.

0
  • Navigate to Control Panel > Programs > Programs and Features and repair the IIS Express.
  • Restart the visual studio.

To turn on the IIS is not recommended as other comments suggests if you are not using your system as a live server. For development purpose only IIS Express is adequate.

Not the answer you're looking for? Browse other questions tagged or ask your own question.