Click here to Skip to main content
15,037,006 members
Please Sign up or sign in to vote.
3.67/5 (2 votes)
See more:
Hey all, I have an odd error I need advise on, I installed the latest version of Visual studios professional edition a few days ago, the default project worked fine the first time but ever since then I've had this error every time I run any website, including the default not changed template and a blank hello world website.

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

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

Any suggestions? any google searching I did came up with generic errors which weren't related to this problem.

The error happens on all browsers too, although the first time it ran it worked on chrome
Abhishek Pant 29-Dec-12 20:35pm
update your browser and I think your new webservices for vs are not configured correctly
Phoenix234 30-Dec-12 6:08am
My browser is updated as far as I can tell ( Chrome autoupdates and IE seems to be at the latest version)

How do I configure my web service properly?
Sergey Alexandrovich Kryukov 29-Dec-12 21:40pm
Whatever it is, it is not related to Visual Studio, not in any sense.

You show some exception trace (your bug is trivial, it could be just empty collection, or you try to access index more then count minus 1), and not code. How can we see what's wrong? Due to the end of the year, my access to your hard drive through a chimney is somewhat limited :-)

Phoenix234 30-Dec-12 6:13am
How do I show you more detail, since I'm having problems with this in the first place and haven't given more detail to start it seems logical to assume I don't know how to provide such detail.

The sarcastic comment seems both rude and inappropriate to be seen on a help website.
Sergey Alexandrovich Kryukov 30-Dec-12 13:11pm
Your attitude is no good. I'm trying to help and you are playing the offended card. Where did you see a single rude word from me. This is you who is negative and impatient. Who will help you after that? Only such patient people as I am.

Yes, you can. The description of the exception suggests it was the exception caused by some source code. You could include a sample of such code in your question. Or do I miss anything?

Phoenix234 30-Dec-12 13:27pm
I mentioned in the question the source won't really help unless I know which part of the source you are after since as I said earlier...
"I've had this error every time I run any website, including the default not changed template and a blank hello world website."

It literally happens in 100% of projects, all new projects and old where the error didn't arise not to mention template projects with not one line of code changed from when I loaded the template.

I found your original comment unnecessary as you could have started by saying " We can't solve it without more code can you attach X"instead it implies I had more to send but didn't want to send it which seems silly. Although I don't see how my reply is bad either as all I said was I felt the comment was inappropriate. Either way this bickering isn't going to get me anywhere so what do you specifically need to be shown? since all projects give the error.
Sergey Alexandrovich Kryukov 30-Dec-12 13:46pm
A minimalistic Web project could be just few lines of code. Can you make and try one? Also, you can try to log exception information on server side. This way, you can get also the line of the source code which throws exception...

Your VS installation or Web browser installation could also be damaged, if not the OS. Did you try to re-install anything?
Phoenix234 30-Dec-12 14:03pm
Empty projects give this too. Ive just made one that only has 2 parts, the default Web.config and a pretty much blank html page.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="">
<head runat="server">
<form id="form1" runat="server">

and the web.config

For more information on how to configure your ASP.NET application, please visit
<compilation debug="true" targetframework="4.5">
<httpruntime targetframework="4.5">

Theres nothing more to this project and i still get that error. The only thing I can imagine is its an error todo with the program not the projects but I don't have the knowledge to test it.

I searched the entire project for the word "site" which is the parameter it doesn't like and nothing exists.

How do I log the exception information?
Sergey Alexandrovich Kryukov 30-Dec-12 14:08pm
OK, that's better. But your situation is worse. It looks like your environment is broken, unfortunately. Any change to try out anything on another system?
Phoenix234 30-Dec-12 15:01pm
I own the only compatible computer in my house, suggestions?

would a reinstall work at all? I'm not sure what could set this up wrong, did you look at the other solutions? They haven't replied so I don't know if they will work or not

While I'm here How do I log the exception information?
Sergey Alexandrovich Kryukov 30-Dec-12 19:37pm
Put it this way, trying to re-install is better than not trying it. Start with reinstallation of VS. The solution 1? I don't see how it is related to your situation.
Phoenix234 31-Dec-12 5:14am
Then I have no idea what to do, do you have any idea what the other 2 comments mentioned at all? I don't recognise what they were talking about and google didn't explain where I was looking.

One of the tools for logging, a very popular one, is Apache Log4Net:[^].


In short: Go to Control Panel > Programs > Turn Windows features on or off and enable Internet Information Services.

See: relevant thread on StackOverflow

The OpenMappedWebConfiguration method is missing the parameter for site. Drop any string in there to fix it such as "my website".
Phoenix234 30-Dec-12 6:10am
I did a search for "OpenMappedWebConfiguration" and nothing came up, Can you be more descriptive in what I'm exactly doing? Last thing I want is to break it more by making a small mistake.

Not to mention if this is happening on ALL new default projects then does that mean its set up wrong entirely?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900