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

190,097

Solution 1

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

Solution 2

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.

Solution 3

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

Solution 4

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.

Solution 5

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

Share:
190,097

Related videos on Youtube

Rahul_RJ
Author by

Rahul_RJ

Updated on July 17, 2020

Comments

  • Rahul_RJ
    Rahul_RJ almost 4 years

    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
    
    • Sriram Sakthivel
      Sriram Sakthivel almost 11 years
      where this exception is thrown?
    • Rahul_RJ
      Rahul_RJ almost 11 years
      Exception is thrown while showing the Web Page after Debugging.
    • Sriram Sakthivel
      Sriram Sakthivel almost 11 years
      Not clear post some code which line this exception is thrown
    • Rahul_RJ
      Rahul_RJ almost 11 years
      Now see I have also Given the Error shown while showing the Web Page
    • Simon Belanger
      Simon Belanger almost 11 years
      @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.
    • Sriram Sakthivel
      Sriram Sakthivel almost 11 years
      @Rahul_RJ post which point in your code exactly throws exception
    • Rahul_RJ
      Rahul_RJ almost 11 years
      No there are no Exceptions at the Time of Rebuild, But after Debugging only this Error is shown on the Browser
    • ProgrammingLlama
      ProgrammingLlama over 6 years
      Windows 10 updated this morning caused this issue for me. I'm glad I found your question :)
  • Zahid Riaz
    Zahid Riaz over 10 years
    Worked well. Visual Studio should have tell that straight forward. IIS is not enabled. Thanks Man
  • Václav Dajbych
    Václav Dajbych about 10 years
    Thank you, it worket for me too. Why IIS Express needs IIS installed? I don't understand that. I use default web.config, nothing special.
  • Tsasken
    Tsasken almost 10 years
    I know this is an old answer, but I recently encountered this error. With me, the fault was that I was trying to run 2 different websites in 2 different visual studio solutions. I think IIS Express only allows for 1 concurrent visual studio solution to run at once. So, when you need to have 2 solutions active on IIS, you need to enable IIS using the windows features. If not, you just have to make sure there's only one solution running on IIS Express at any given time.
  • bbbwex
    bbbwex almost 10 years
    Same as Tsasken, I just got it a bit earlier today. Thanks to MustafaP for the answer and in general to Stackoverflow and associated sites for the help I've had!!! fixed the prob in 30 min since it popped up.
  • timbillstrom
    timbillstrom about 7 years
    After a Windows-update this issue got me. Solution still works today! Windows 10 Pro Insider Preview Build 16199.rs_prerelease.170513-2252
  • jpda
    jpda about 7 years
    You don't need all of IIS, you can just install IIS Management Console (IIS --> Web Management Tools --> IIS Management Console).
  • BobK
    BobK about 7 years
    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.
  • Auri Rahimzadeh
    Auri Rahimzadeh almost 7 years
    You don't have to install all of IIS - just tick the box and take the defaults. Making sure that's clear :)
  • Boris Lipschitz
    Boris Lipschitz almost 7 years
    Crazy! This question was asked 4 years ago and the issue resurfaced again in Insider Preview Build
  • Kevin Coulson
    Kevin Coulson almost 7 years
    Just had this issue on Insider Preview Build 16257.rs3_release.170728-1700 so it is still occurring!
  • Bastien Vandamme
    Bastien Vandamme almost 7 years
    Got it with Windows 10 Pro Insider Preview Evaluation copy. Build 16281.rs3 release.17D82g-1438. Thank for this solution. I also only installed the IIS Management Console.
  • LucasMetal
    LucasMetal over 6 years
    Got the error with the Win10 Fall creators update, installing only the "Hostable Web Core" did the trick. Thanks ;)
  • LucasMetal
    LucasMetal over 6 years
    Got the error with the Win10 Fall creators update, installing only the "Hostable Web Core" did the trick. Thanks ;)
  • user2006616
    user2006616 over 6 years
    Repair can be found in "Programs and Features" - the "classic" control panel.
  • Vitor Rigoni
    Vitor Rigoni over 6 years
    Same here! Repairing IIS 10.0 Express fixed. Thanks!
  • Stefan Z Camilleri
    Stefan Z Camilleri over 6 years
    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.
  • Thomas927
    Thomas927 over 6 years
    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.
  • Jim Taliadoros
    Jim Taliadoros over 6 years
    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.
  • akokani
    akokani over 6 years
    GOD DAMN YOU MICROSOFT GOD BLESS YOU GUYS
  • Code Animal
    Code Animal over 6 years
    After updating to Windows 10 Fall Creators Update, repairing IIS Express sorted my issue. Many thanks!
  • Mike Devenney
    Mike Devenney over 6 years
    4 years later and the answer still holds up. Windows 10 Update installed and IIS went away. Seriously, WTF MS...
  • Brent Keller
    Brent Keller over 6 years
    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.
  • Episodex
    Episodex over 6 years
    Don't you think it's completely ridiculous that you have two interfaces for Add/Remove programs in one system and they have different features (you can't repair from "new" one)?
  • camelCase
    camelCase over 6 years
    This solution worked for me when I was blocked by a grayed out Modify button in Control Panel add/remove programs.
  • Fidel Garcia
    Fidel Garcia over 6 years
    Solution still works for Windows 10, version 1709 (OS Build 16299.64)
  • Stefanvds
    Stefanvds over 6 years
    Didn't have to restart VS
  • Will Appleby
    Will Appleby over 6 years
    Repair IISExpress fixed this for me too after Fall Creators Update.
  • aspirant_sensei
    aspirant_sensei over 6 years
    lovely, system update screwed me too :) lack of coffee made me just google the exception and I'm glad I did as I would have never thought of IIS being the issue !
  • Daniel Liuzzi
    Daniel Liuzzi over 6 years
    Make sure you shut down IIS Express before you repair it. Right-click the icon in the notification area and click Exit. Repairing IIS Express while it's running won't show any error, but it will not fix the issue either.
  • Chtioui Malek
    Chtioui Malek over 6 years
    5 Years later, and still the same issue (and solution), Windows Automatic Update and BOOM
  • TheMentor
    TheMentor over 6 years
    I really think that Microsoft has a few old people collecting fat paychecks and stuff like these are run by bunch of students and interns. How the hell can this happen.
  • Nitesh
    Nitesh over 6 years
    Still holds true. Faced this error after running a Windows update.
  • Mr. Young
    Mr. Young over 6 years
    Happened to me too after a Windows up with IIS Express. I had to install the windows feature 'IIS Hostable Web Core' in order to fix the issue. Merely reparing/uninstall/install/combinations didn't fix it. But installing the windows feature seems to "repair" IIS Express.
  • Alaa'
    Alaa' over 6 years
    I always faced same issue after updating my Windows 10 Pro
  • DanielG
    DanielG over 6 years
    Just an FYI; I received a Windows Update this morning, and thereafter I had this issue. As others have suggested, using the Repair option Control Panel still works. In my case, I ran a repair on the program titled "IIS 10.0 Express".
  • Patrick Borkowicz
    Patrick Borkowicz over 6 years
    Installed the Creators Update somewhat late, on 2018-01-24 and this happened. It actually seems to have removed IIS Express. I would certainly call this a breaking change. Why is it still part of their release?
  • AhabLives
    AhabLives over 6 years
    2018 here - windows 10 pushed an update out last night. This problem came to be. This solution still worked. Thank you.
  • Geovani Anholete
    Geovani Anholete over 6 years
    I upgraded my windows and had the same problem. The answer is still valid!
  • kexx
    kexx over 6 years
    you the man, microsoft fcked up with its falls creator update sht, you fixed it. you worth more than the entire company
  • Jure
    Jure over 6 years
    Worked for me too! Thanks!
  • SBF
    SBF over 6 years
    Classic "Programs and features" can be started by typing appwiz.cpl in start menu
  • auhmaan
    auhmaan about 6 years
    -1 Despite being an old answer, it would be better to specify which options to turn on, as the tick, being a square, means that only some options are active, and not all. In order to prevent turning on something we don't want, security reasons for instance, it would be better if someone could supply the full tree of active options.
  • Thanos Paravantis
    Thanos Paravantis about 6 years
    Thank you for this, it actually solved my issue right away. Regardless, it's worth noting that if you use localhost alongside other frameworks and programs, port 80 will be blocked by IIS.
  • UserX
    UserX over 5 years
    Enabling IIS Express and restarting didn't work for me. Tried the repair option and Windows refused to do it. Downloaded the Program Install and Uninstall Troubleshooter as described here: thewindowsclub.com/cannot-install-uninstall-programs-windows‌​-7 and uninstalled IIS Express. Then downloaded IIS Express and re-installed. Then it worked. Surprising how often tasks that should take minutes take hours when Microsoft products are involved.
  • Sumith Harshan
    Sumith Harshan over 5 years
    I'm using IIS and this method is solved my above issue. Thank you
  • vibs2006
    vibs2006 almost 5 years
    Best Solution. Worked for me like a charm.
  • user2728841
    user2728841 over 4 years
    This fixed it for me - vanilla install of Visual Studio 2019 in Windows Server 2019. Didn't need a reboot.
  • Ulysses Alves
    Ulysses Alves over 4 years
    @ZahidRiaz have you ever seen the error in which Visual Studio says: "Catastrofic Failure." and closes itself? You might think the world would end after this message, but you then just reopen VS and everything is nice again.