title: C# HtmlAgilityPack TypeAccessException when loading page from Url
body: <p>I am trying to develop a windows phone app which parses an HTML page (retrieved over the web) into a HTMLDocument variable and use that to inspect the page, retrieve values etc etc. Even when trying to connect to pages like the <a href="http://www.bbc.co.uk/news" rel="nofollow">BBC News Home page</a> I am getting an error.</p>
  
  <pre><code>System.TypeAccessException: Attempt by security transparent method 'HtmlAgilityPack.HtmlWeb.LoadFromWebAsync(System.Uri, System.Text.Encoding, System.Net.NetworkCredential)' to access security critical type 'System.Net.NetworkCredential' failed.
     at HtmlAgilityPack.HtmlWeb.LoadFromWebAsync(Uri uri, Encoding encoding, NetworkCredential credentials)
     at HtmlAgilityPack.HtmlWeb.&lt;LoadFromWebAsync&gt;d__0.MoveNext()
  </code></pre>
  
  <p>This page shouldn't need credentials so I am very confused as to why I am encountering this error. Here is the code.</p>
  
  <pre><code>private async Task GetHtmlDocument(string url)
  {
      Debug.WriteLine("This is a line");
      try
      {
          HtmlWeb web = new HtmlWeb();
          HtmlDocument rootDocument = await web.LoadFromWebAsync(url);
      }
      catch (Exception e)
      {
          Debug.WriteLine("Exception: " + e);
      }
  }
  </code></pre>