Solved

"The remote name could not be resolved" on WebRequests

Posted on 2008-06-25
4
5,512 Views
Last Modified: 2013-12-16
I'm getting this error:

System.Net.WebException: The remote name could not be resolved: 'www.microsoft.com'
   at System.Net.HttpWebRequest.GetResponse()

on any kind of WebRequest, such as:

            WebRequest req2 = WebRequest.Create("http://www.microsoft.com");
            WebResponse res2 = req2.GetResponse();

or
            FtpWebRequest req = (FtpWebRequest)WebRequest.Create("ftp://" + host );
            req.Method = WebRequestMethods.Ftp.ListDirectory;
            req.Credentials = new NetworkCredential(username, password);
            req.KeepAlive = false;
            req.UseBinary = true;
            req.UsePassive = false;
            req.CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache);
            res = (FtpWebResponse)req.GetResponse();

I can reach these hosts via browser or command line.   There is no proxy server.  My Windows Firewall is disabled and my Kaspersky Internet Security software is turned off.  This USED TO WORK YESTERDAY!!  The only thing i did was upgrade from Visual Studio 2008 Express to Pro.  I re-opened up the project in Express and it still fails.  I suspect the install changed permissions or restrictions.  Are there xml files in my project i need to edit?  I don't know much about dot net.  I'm a Java guy.

Thanks!!!
0
Comment
Question by:thumky
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
4 Comments
 

Author Comment

by:thumky
ID: 21867342
By the way no firewall changes.  I'm the only one w/ the password.
0
 

Author Comment

by:thumky
ID: 21867409
AHA!!  I found an exe i compiled before my upgrade.  It ran perfectly!  So its not the network, its the new Visual Studio environment.

Any thoughts?
0
 

Author Comment

by:thumky
ID: 21867562
this is .NET Framwork 2.0.  I'm going to rebuild the project from scratch
0
 

Accepted Solution

by:
thumky earned 0 total points
ID: 21867687
I rebuilt from scratch and now its okay.  I'll assign points to anyone who can help me learn something constructive from this...
( other than 'when you have a problem w/ Microsoft you need to continually reboot and rebuild until it works!' )
0

Featured Post

Major Serverless Shift

Comparison of major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question