Der entfernte Name konnte nicht aufgelöst werden - webclient
Ich stehe vor diesem Fehler:
The remote name could not be resolved: 'russgates85-001-site1.smarterasp.net'
Wenn ich HTML-Inhalte zum Lesen mit dem Webclient anfordere, erhalte ich eine Fehlermeldung. Unten ist mein Code.
string strHTML = string.Empty;
WebClient myClient = new WebClient();
UTF8Encoding utf8 = new UTF8Encoding();
byte[] requestHTML;
string pdfFileName = "outputpdf_" + DateTime.Now.Ticks + ".pdf";
string webUrl = Request.Url.Scheme + "://" + Request.Url.Host + (Request.Url.Port != 80 ? ":" + Request.Url.Port : "");
requestHTML = myClient.DownloadData("http://russgates85-001-site1.smarterasp.net/adminsec/images/printinvoice.aspx?iid=2");
// OR
requestHTML = myClient.DownloadData(webUrl + "?iid=3");
Wenn ich die gleiche URL in meinen lokalen Code / meine Umgebung lege, funktioniert das einwandfrei.