简体   繁体   English

找不到WP 8.1的System.Net.Sockets程序集

[英]Cannot find System.Net.Sockets assembly for WP 8.1

I'm trying to create an app which works as a remote-control for my musicplayer. 我正在尝试创建一个可用作音乐播放器遥控器的应用程序。 I've just finished written a nice library for my code and I just now noticed there is no assembly called System.Net.Sockets for Windows Phone 8.1? 我刚刚为代码编写了一个不错的库,现在我才注意到没有用于Windows Phone 8.1的名为System.Net.Sockets的程序集? There must be a solution to this, but I just cannot find it. 必须对此有解决方案,但我找不到。 Does anyone know how I might be able to import it to my project? 有谁知道我如何能够将其导入到我的项目中?

According to Microsoft , you should be using Windows.Networking.Sockets instead: 根据Microsoft的说法,您应该使用Windows.Networking.Sockets代替:

The Windows Runtime API, Windows.Networking.Sockets, has been adopted for Windows Phone 8. It has been implemented as a Windows Phone Runtime API, making it easy to use in whatever supported programming language you choose. Windows Phone 8已采用Windows运行时API Windows.Networking.Sockets。它已实现为Windows Phone运行时API,因此可以轻松地在您选择的任何支持的编程语言中使用。 Although we've enhanced the .NET API, System.Net.Sockets, to support more features such as IPv6 and listener sockets, you should consider using the new API for sockets programming because it is more portable than the .NET API. 尽管我们增强了.NET API System.Net.Sockets,以支持更多功能,例如IPv6和侦听器套接字,但是您应该考虑使用新的API进行套接字编程,因为它比.NET API更可移植。 Windows.Networking.Sockets has been built from the ground up to be clean, secure, and easy-to-use APIs that enforce best practices. Windows.Networking.Sockets是从头开始构建的,用于强制实施最佳实践的干净,安全和易于使用的API。

In WinRT, this is what you need to do. 在WinRT中,这是您需要做的。 Here's an answer to a related question for further reading. 这是一个相关问题的答案 ,供您进一步阅读。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM