This project has moved and is read-only. For the latest updates, please go here.

Error with URI

Topics: Developer Forum
Nov 11, 2009 at 3:48 PM
Edited Nov 12, 2009 at 11:23 AM



I am using the HAP with my website, when I run the following code I get an error



            HtmlDocument htmlDoc = new HtmlDocument();

            htmlDoc.OptionFixNestedTags = true;



The last time "htmlDoc.Load" throws an error "URI formats are not supported."  I am doing the development work within Visual Studio 2010 Beta 2 and using the local IIS server to run the website and its using the default home page, this means my url is "http://localhost:14049/default.aspx"

Any ideas how I can fix this??


Thanks in advance





This is the stack trace

[ArgumentException: URI formats are not supported.]
   System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength) +9457990
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +370
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +82
   System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) +84
   System.IO.StreamReader..ctor(String path, Encoding encoding) +16
   HtmlAgilityPack.HtmlDocument.Load(String path) +112
   WebApplication3.WebForm1.newstuff(String urlToConvert) in C:\Users\mxg.CONSULT-ALTIUS\Documents\Visual Studio 2010\Projects\WebApplication3\WebApplication3\default.aspx.cs:136
   WebApplication3.WebForm1.convertTwo_Click(Object sender, EventArgs e) in C:\Users\mxg.CONSULT-ALTIUS\Documents\Visual Studio 2010\Projects\WebApplication3\WebApplication3\default.aspx.cs:118
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563


Nov 17, 2009 at 10:33 AM
Edited Nov 24, 2009 at 3:23 PM



Nov 29, 2009 at 12:47 PM

I'm not entirely sure but load only loads from disk not the web.