Skip to content

Commit df28569

Browse files
authored
Update DNS resolution method in SocketAddress example (#11970)
'Resolve has been deprecated. Use GetHostEntry instead.'
1 parent 975cee0 commit df28569

File tree

1 file changed

+1
-1
lines changed
  • snippets/csharp/System.Net/SocketAddress/Overview

1 file changed

+1
-1
lines changed

snippets/csharp/System.Net/SocketAddress/Overview/source.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static void MySerializeIPEndPointClassMethod(){
1010
//<Snippet1>
1111

1212
//Creates an IpEndPoint.
13-
IPAddress ipAddress = Dns.Resolve("www.contoso.com").AddressList[0];
13+
IPAddress ipAddress = Dns.GetHostEntry("www.contoso.com").AddressList[0];
1414
IPEndPoint ipLocalEndPoint = new IPEndPoint(ipAddress, 11000);
1515

1616
//Serializes the IPEndPoint.

0 commit comments

Comments
 (0)