How to set proxy Webclient to null?

advertisements

I tried this code

WebClient wc = new WebClient();
wc.Proxy = null;

but I get System.Net.Webclient does not contain definition for proxy


That is System.Net.WebClient does not contain a definition for proxy.
If you check MSDN you see that the webclient does not have a property named Proxy.

If you check the MSDN page for the normal webclient (non-Silverlight/non-phone) version you see the Proxy property. But that is not included in the stripped down version for the windows phone, because in your Phone you cant set a proxy.

So no need to set it to null. Since the property doesn't exist. Just remove that line.