Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# ASP.NET MVC Basics Controllers Adding an Action to a Controller

Nathan Partridge
Nathan Partridge
52,420 Points

I seem to get an unhandled ArgumentOutOfRangeException when trying run the app

I seem to be getting the following response whenever I run the application. Following along with .NET version 4.6.1 on Windows 10 with VS 2017. The following is the listing of the response.

Server Error in '/' Application. Specified argument was out of the range of valid values. Parameter name: site Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: site

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

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) +280

[HttpException (0x80004005): Specified argument was out of the range of valid values. Parameter name: site] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10043436 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2633.0

1 Answer

Nathan Partridge
Nathan Partridge
52,420 Points

Finally found a solution to this problem on Stack Overflow after googling "Parameter name: site" from the stack trace. For any one else finding them running into this, here is the link: Stackoverflow Link