0

I am Using Visual Studio 2015, with Windows 10 hp laptop. After I created an asp.net mvc application, build it and run it I get this error:

Specified Argument was out of the range of valid values Parameter name : site
Description : An unhanded Exception occurred during the execution of the current web request
Stack Trace:
[ArgumentOutOfRangeException: Specified Argument was out of the range of valid values. Parameter Name: site]
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags, hostingFlags, PolicyLevel, policylevel, Exception appDomainCreationException) +560
[HttpException (0x80004005): Specified Argument was out of the range of valid values. Parameter Name: site]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +765
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerReuest wr, HttpContext context) +195

René Vogt
  • 43,056
  • 14
  • 77
  • 99
Victor.Uduak
  • 2,734
  • 2
  • 18
  • 24
  • 1
    Welcome to StackOverflow! Please show the code that throws this exception. Without code, there is no way someone could tell the reason for this error. – René Vogt Aug 19 '16 at 08:32
  • 1
    this error occurs on start up, i don't think its a code related problem – Victor.Uduak Aug 19 '16 at 09:59
  • 1
    Victor, I had the exact same problem and of course there is no code to show. But the problem is solved by your answer below. Thank you. – AH. Nov 27 '17 at 15:41

1 Answers1

18

This Solved the problem

go

  • Control Panel
  • Programs and Features
  • Turn Windows Features on or off
  • tick Internet Information Services
  • then Restart Laptop

It worked for me

I found that answer here

Community
  • 1
  • 1
Victor.Uduak
  • 2,734
  • 2
  • 18
  • 24
  • That is considering the OT has admin rights on the machine and it is possible to just go ahead and install IIS. I have the same issue but i cannot install IIS, we only use IISExpress, which should be OK. – samiup Feb 14 '17 at 21:56
  • 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**. – Thanos Paravantis May 16 '18 at 15:41