Solved

"The remote name could not be resolved" on WebRequests

Posted on 2008-06-25
4
5,284 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
  • 4
4 Comments
 

Author Comment

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

Author Comment

by:thumky
Comment Utility
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
Comment Utility
this is .NET Framwork 2.0.  I'm going to rebuild the project from scratch
0
 

Accepted Solution

by:
thumky earned 0 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now