Multimobile Development: Building Applications for any Smartphone
Internal problem on XmlDocument.Load( )
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Whugster
I have this really frustrating problem when calling XmlDocument.Load(string
filename). Whenever I call this method in a web application in my Windows XP
development PC, I get the following error:

Specified argument was out of the range of valid values. Parameter name: The
specified value must be greater than 0.

Here's the stack trace:
-------------------------
[ArgumentOutOfRangeException: Specified argument was out of the range of
valid values.
Parameter name: The specified value must be greater than 0.]
System.Net.ServicePoint.set_ConnectionLimit(Int32 value) +60
System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials
credentials) +282
System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials
credentials) +94
System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type
ofObjectToReturn) +55
System.Xml.XmlTextReader.CreateScanner() +384
System.Xml.XmlTextReader.Init() +23
System.Xml.XmlTextReader.Read() +530
System.Xml.XmlValidatingReader.ReadWithCollectTextToken() +146
System.Xml.XmlValidatingReader.Read() +26
System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean
preserveWhitespace) +80
System.Xml.XmlDocument.Load(XmlReader reader) +72
System.Xml.XmlDocument.Load(String filename) +78
..[my functions in here]...
-----------------------

The culprit seems to be in the System.Net.ServicePoint.ConnectionLimit
property, but this property is set inside a method called GetNonFileStream
and I see some credentials stuff going on in there. Maybe permission issue?
This error never happens in production Win2003 machines and in other WinXP
PCs.

Reply to this message...
Vote that this is a GOOD answer...
 
Really good experience at the Apple Store
MonoDroid – looking *awesome*
 
    
Helena Kupkova [MSFT] (VIP)
This is a known bug caused by a .Net Framework patch that changed the default connection limit forlocalhost to maxint. It will be fixed in the next service pack (both 1.0 and 1.1). The workaround is to use file or UNC path instead of http://localhost, or setting ServicePoint.ConnectionLimit for localhost to something lower than maxint.

-Helena

(This posting is provided "AS IS" with no warranties, and confers no rights.)
Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Yan Leshinsky (VIP)
Can you send me a more complete repro.
Thanks, Yan

"Whugster" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Yan Leshinsky (VIP)
I will investigate and get back to you.
Yan

"Whugster" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
 
System.ArgumentOutOfRangeException
System.Net.ICredentials
System.Net.ServicePoint
System.Xml.XmlDocument
System.Xml.XmlReader
System.Xml.XmlTextReader
System.Xml.XmlUrlResolver
System.Xml.XmlValidatingReader




Multimobile Development: Building Applications for any Smartphone
Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734