Visual Studio .NET - Too many automatic redirections -HTTPWebRequest
Asked By Peter Bromberg
09-Sep-01 11:56 AM

I'm experimenting with some c# webservice code that is designed to return the most recent say, 3 days of "HOWTOS"
from the MS Search service.
Here is a sample working GET URL. You can paste this into IE and it will return a result page. (sorry about any wrapping):
http://search.support.microsoft.com/kb/psssearch.asp?SPR=msall&KT=ALL&T=N&T1
=3d&LQ=HOWTO&PQ=PastQuery&S=F&A=T&DU=C&FR=0&D=support&LPR=&LNG=ENG&VR=http%3
A%2F%2Fsupport.microsoft.com%2Fsupport%3Bhttp%3A%2F%2Fsupport.microsoft.com%
2Fservicedesks%2Fwebcasts%3Bhttp%3A%2F%2Fsupport.microsoft.com%2Fhighlights&
CAT=Support&VRL=ENG&SA=GN&Go.x=34&Go.y=20
-- My problem is that in a webservice call:
HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(serverURL);
HttpWebResponse webresp = (HttpWebResponse)webreq.GetResponse();
StreamReader strm = new StreamReader(webresp.GetResponseStream(),
Encoding.ASCII);
StringBuilder strContent = new StringBuilder("");
sTemp="<MSInfoResponse>";
sContentTemp = strm.ReadToEnd();
strContent.Append(sContentTemp);
string contents=strContent.ToString();
strm.Close();
sTemp+=contents+"</MSInfoResponse>";
result=sTemp;
-- this returns the following exception:
System.Net.WebException: Too many automatic redirections attempted.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at MSInfoService.GetInfo(String sType, String sDays)
Anybody got any ideas?
MaximumAutomaticRedirections Property
The Uri you access wants you to set
HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(serverURL);
webreq.UserAgent="Mozilla/4.0 (compatible; MSIE 6.0b; Windows NT 5.0)"
HttpWebrequest has a property MaximumAutomaticRedirections that is set to 30 or so by default.
Visual Studio .net .NET Framework Hi NG, ich habe vor längerer Zeit mit Visual Studio .Net 2003 gearbeitet und überlege momentan auf einen neueren Stand upzudaten. Ein Visual Studio .Net 2008 scheint es nicht zu geben. Habe zumindest mit googeln nichts gefunden. Was
Wise for Visual Studio.NET Wise for Visual Studio.NET By Peter A. Bromberg, Ph.D. To "Print This Page" Link Peter Bromberg Wise for Visual Studio .NET is a total and complete installation development system for creating and editing Windows® Installer
Visual Studio versioning . . . . how to tell? .NET Framework To my knowledge, Visual studio 6 was released in 1998, then Visual Studio .NET 2002 is VS 7, then Visual Studio .NET 2003 is VS 7.1, then Visual
visual studio.net 2003 and Access 2007 database .NET Framework Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great success. Now
Is Visual Studio self-hosting ? .NET Framework Does Microsoft use Visual Studio IDE, Visual Studio Debugger, Visual Studio Linker and Visual Studio compiler for developing Visual Studio ? Or is Visual Studio not