TcpListener 不包含 "AcceptSocket" 的定义

TcpListener does not contain a definition for "AcceptSocket"

This is the error screenshot当我在Vs2017中编写TcpClient-Server程序时出现了以下问题。

Console.WriteLine("Waiting for a connection.....");     
Socket s=myList.AcceptSocket();
Console.WriteLine("Connection accepted from " + s.RemoteEndPoint);`

说TcpListner不包含一个不包含这样的方法。 请帮忙。完整代码可以在 https://www.codeproject.com/Articles/1415/Introduction-to-TCP-client-server-in-C

找到

感谢和问候, T.S.

上面代码中发生的事情不是使用 .NET Framework 控制台应用程序,而是使用 .NET Core,它不是导致错误的兼容应用程序。原因是 MS 站点在所有以前的程序中都使用 .NET Core,尽管这也是如此。