Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Errors
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
Posted 29-Dec-12 11:01am
Comments
Abhishek Pant at 29-Dec-12 20:35pm
   
update your browser and I think your new webservices for vs are not configured correctly
Phoenix234 at 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 at 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 :-)
 
—SA
Phoenix234 at 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 at 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?
 
—SA
Phoenix234 at 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 at 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?
—SA
Phoenix234 at 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="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Hi!
</div>
</form>
</body>
</html>
 
and the web.config
 

<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->






 

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 at 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?
—SA
Phoenix234 at 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 at 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.
—SA
Phoenix234 at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The OpenMappedWebConfiguration method is missing the parameter for site. Drop any string in there to fix it such as "my website".
  Permalink  
Comments
Phoenix234 at 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?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

One of the tools for logging, a very popular one, is Apache Log4Net: http://logging.apache.org/log4net/[^].
 
—SA
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 686
1 OriginalGriff 385
2 CPallini 240
3 PIEBALDconsult 150
4 Magic Wonder 131
0 OriginalGriff 5,795
1 Sergey Alexandrovich Kryukov 5,158
2 CPallini 4,740
3 George Jonsson 3,167
4 Gihan Liyanage 2,450


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 30 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100