Link to home
Start Free TrialLog in
Avatar of thumky
thumkyFlag for United States of America

asked on

"The remote name could not be resolved" on WebRequests

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!!!
Avatar of thumky
thumky
Flag of United States of America image

ASKER

By the way no firewall changes.  I'm the only one w/ the password.
Avatar of thumky

ASKER

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?
Avatar of thumky

ASKER

this is .NET Framwork 2.0.  I'm going to rebuild the project from scratch
ASKER CERTIFIED SOLUTION
Avatar of thumky
thumky
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial