HttpWebRequest.GetResponse failing continuously until program reset
<p>Occasionally on some machines, a web request will fail with the following message and continue to do so until the program is reset at which time it will start working again. Has anyone else experienced this and is there any programmatic way to prevent it? </p>

<p><code>Message: The remote name could not be resolved: 'www.validwebsite.com'
Source: System
StackTrace:    at System.Net.HttpWebRequest.GetResponse()</code></p>

<p>EDIT: This is the code the that is being executed</p>

<pre><code>    virtual public string Execute(string web_uri,string request_method,string data = null, string content_type = null)
    {
        WebRequest webRequest = WebRequest.Create(web_uri);
        webRequest.Method = request_method;
        if (content_type != null)
        {
            webRequest.ContentType = content_type;
        }
        webRequest.Method = request_method;
        byte[] bytes = new byte[0];
        if (!string.IsNullOrEmpty(data))
        {
            bytes = Encoding.ASCII.GetBytes(data);
            // send the Post
            webRequest.ContentLength = bytes.Length;   //Count bytes to send
        }
        else
        {
            webRequest.ContentLength = 0;
        }
        if (webRequest.Method == "POST")
        {
            using (Stream os = webRequest.GetRequestStream())
            {
                os.Write(bytes, 0, bytes.Length);         //Send it
            }
        }
        using (HttpWebResponse webResponse =(HttpWebResponse)webRequest.GetResponse())
        {
            if (webResponse != null)
            {
                ResponseCode = webResponse.StatusCode;
                using (StreamReader sr = new StreamReader(webResponse.GetResponseStream(),Encoding.UTF8))
                {
                    string xml_string = sr.ReadToEnd().Trim();
                    return xml_string;
                }
            }
        }
        return null;
</code></pre>
