Forum Xamarin.Forms

ServicePointManager and many other System.Net classes are not available in Xamarin projects

I am using Xamarin V2.0.0.6482 with .NET v4.5 and I'm trying to set a security protocol in the ServicePointManager class, but Visual Studio does not recognize the class and the project does not build. If I check what classes from the System.Net namespace I can use it is a very short list.

I'm trying to execute this line of code:
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

and this is the error I'm getting:
The type or namespace name 'ServicePointManager' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)

What could be causing this?

Best Answer


Sign In or Register to comment.