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 :
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
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
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.
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.
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
Project Properties (right click project in solution explorer and select properties)
select Web tab
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.
Source: Stackoverflow.com