[c#] Specified argument was out of the range of valid values. Parameter name: site

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

This question is related to c# visual-studio iis web-config

The answer is


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.


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


  • 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.


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


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.


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.


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


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.


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.


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.


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.


Examples related to c#

How can I convert this one line of ActionScript to C#? Microsoft Advertising SDK doesn't deliverer ads How to use a global array in C#? How to correctly write async method? C# - insert values from file into two arrays Uploading into folder in FTP? Are these methods thread safe? dotnet ef not found in .NET Core 3 HTTP Error 500.30 - ANCM In-Process Start Failure Best way to "push" into C# array

Examples related to visual-studio

VS 2017 Git Local Commit DB.lock error on every commit How to remove an unpushed outgoing commit in Visual Studio? How to download Visual Studio Community Edition 2015 (not 2017) Cannot open include file: 'stdio.h' - Visual Studio Community 2017 - C++ Error How to fix the error "Windows SDK version 8.1" was not found? Visual Studio Code pylint: Unable to import 'protorpc' Open the terminal in visual studio? Is Visual Studio Community a 30 day trial? How can I run NUnit tests in Visual Studio 2017? Visual Studio 2017: Display method references

Examples related to iis

ASP.NET Core 1.0 on IIS error 502.5 CS1617: Invalid option ‘6’ for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default Publish to IIS, setting Environment Variable IIS Manager in Windows 10 The page cannot be displayed because an internal server error has occurred on server The service cannot accept control messages at this time NuGet: 'X' already has a dependency defined for 'Y' Changing project port number in Visual Studio 2013 System.Data.SqlClient.SqlException: Login failed for user "This operation requires IIS integrated pipeline mode."

Examples related to web-config

No assembly found containing an OwinStartupAttribute Error IIS Config Error - This configuration section cannot be used at this path How to enable GZIP compression in IIS 7.5 how to set start page in webconfig file in asp.net c# Authentication issue when debugging in VS2013 - iis express Forms authentication timeout vs sessionState timeout Specified argument was out of the range of valid values. Parameter name: site Access-control-allow-origin with multiple domains "An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page..." ASP.NET: HTTP Error 500.19 – Internal Server Error 0x8007000d