I have pretty same problem with XmlDocument.Loa d(). 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(o bject sender, System.EventArg s e)
{
XmlUrlResolver resolver = new XmlUrlResolver( );
resolver.Creden tials = System.Net.Cred entialCache.Def aultCredentials ;
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.Argument OutOfRangeExcep tion: 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\wwwr oot\xmldocbugte st\webform1.asp x.cs Line: 56
Stack Trace:
[ArgumentOutOfRa ngeException: Specified argument was out of the range of valid values.
Parameter name: The specified value must be greater than 0.]
System.Net.Serv icePoint.set_Co nnectionLimit(I nt32 value) +60
System.Xml.XmlD ownloadManager. GetNonFileStrea m(Uri uri, ICredentials credentials) +282
System.Xml.XmlD ownloadManager. GetStream(Uri uri, ICredentials credentials) +94
System.Xml.XmlU rlResolver.GetE ntity(Uri absoluteUri, String role, Type ofObjectToRetur n) +55
System.Xml.XmlT extReader.Creat eScanner() +384
System.Xml.XmlT extReader.Init( ) +23
System.Xml.XmlT extReader.Read( ) +530
System.Xml.XmlL oader.Load(XmlD ocument doc, XmlReader reader, Boolean preserveWhitesp ace) +80
System.Xml.XmlD ocument.Load(Xm lReader reader) +72
XmlDocBugTest.W ebForm1.Button1 _Click(Object sender, EventArgs e) in c:\inetpub\wwwr oot\xmldocbugte st\webform1.asp x.cs:56
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292
Note: it seems to appear only if you access XML file located on your local machine thru the HTTP protocol (in XmlDownloadMana ger.GetNoneFile Stream() 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.