HttpWebRequest.GetRequestStream gone!

  • Thread starter Thread starter msnews.microsoft.com
  • Start date Start date
M

msnews.microsoft.com

Hi,

I'm writing an applcation using the 3.5 framwork, and as part of it I need
to call a webpage.

I'm using HttpWebRequest, and all the MS documentation states to use the
..GetRequestStream method. My problem is that this method just does NOT
exist! All I have that is remotely similair is .BeginGetRequestStream.

Now I know how to use this, but it would be far easier if I could just the
original method.

Does anyone know why this could have disappeared?

Regards
 
msnews.microsoft.com said:
I'm writing an applcation using the 3.5 framwork, and as part of it I need
to call a webpage.

I'm using HttpWebRequest, and all the MS documentation states to use the
.GetRequestStream method. My problem is that this method just does NOT
exist!

Ehhh... Yes it does. I don't know how to put it any other way. The class
System.Net.HttpWebRequest, in assembly System.dll, most certainly has a
method GetRequestStream, taking no arguments and returning a
System.IO.Stream. I'm looking at it right now.

My guess would be that either your Intellisense is malfunctioning, or you're
not looking at System.Net.HttpWebRequest. Have you tried actually calling
the method and compiling, regardless of what Intellisense tells you? Do you
get any errors? If not, Intellisense might be acting up.

- If you're using Visual Basic, make sure to call up all members in
Intellisense as opposed to the limited list you get by default.

- Try exiting Visual Studio, deleting the .suo file of your solution and the
"bin" and "obj" folders of your project (where applicable) and reopen the
solution again.

- If an add-in might be causing trouble, disable them by holding the left
shift key as VS is starting.

If you do get errors, verify that you've got the right class by explicitly
qualifying it as System.Net.HttpWebRequest, and using VS' "go to definition"
feature to see where the object you're using is declared.
 
Aha, erm yes. Feel like a bit of a muppet now.

I'm actually trying the use silverlight.

Cheers for the replies!
 
Nice call on the Silverlight 2 usage!


Patrice said:
Hello,

Do you have Silverlight 2 beta installed ? My first thought would be some
kind of confusion with the Silverlight assembly that AFAIK provides only a
subset of the full .NET 3.5 classes...

What if you just type the method name ? Does it fails at compile time ?
(in case it would be an intellisense only issue)

It works here so this is likely not a .NET 3.5 issue...
 
Back
Top