I have pretty same problem with XmlDocument.Load(). It seems to appear after KB834623 hotfix installed. Here is the information to reproduce error:
Technical info:
• Windows XP Professional SP1
• .NET Framework 1.1
• KB834623 hotfix for .NET Framework 1.1 installed (installing with .NET Speech SDK 1.0)
Steps to reproduce:
1. Create new ASP.NET web application in IIS, for example, XmlDocBugTest
2. Place test XML document in the root of application. Example - test.xml:
<?xml version="1.0" encoding="utf-8" ?>
<test>
123
</test>
3. Place button on any web form (for example, WebForm1.aspx)
4. Place following code for button OnClick handler:
using System.Xml;
//...
private void Button1_Click(object sender, System.EventArgs e)
{
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;
XmlTextReader reader = new XmlTextReader("http://localhost/XmlDocBugTest/test.xml");
XmlDocument doc = new XmlDocument();
doc.XmlResolver = resolver;
doc.Load(reader);
}
5. Load web page and click on button. You will achieve following error:
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: The specified value must be greater than 0.
Source Error:
Line 54: XmlDocument doc = new XmlDocument();
Line 55: doc.XmlResolver = resolver;
Line 56: doc.Load(reader);
Line 57: }
Line 58: }
Source File: c:\inetpub\wwwroot\xmldocbugtest\webform1.aspx.cs Line: 56
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.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +80
System.Xml.XmlDocument.Load(XmlReader reader) +72
XmlDocBugTest.WebForm1.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\xmldocbugtest\webform1.aspx.cs: 56
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
Note: it seems to appear only if you access XML file located on your local machine thru the HTTP protocol (in XmlDownloadManager.GetNoneFileStream() method).
PS: Not only me receive problems with this hotfix. Reference: http://www.mcse.ms/message719906.html
---
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.