简体   繁体   中英

System.Net.Sockets not found in WP8.1 project

Brand new Windows Phone 8.1 project in C#, VS2013 update 4. The using System.Net.Sockets line gives a compilation error:

The type or namespace name 'Sockets' does not exist in the namespace 'System.Net' (are you missing an assembly reference?)

The System.Net assembly is not available in the References dialog - it claims all possible assemblies have been already referenced. Trying to browse to it produces a message that the assembly is already referenced in the project.

What am I missing, please?

EDIT: in a project that's explicitly targeting WP8.0 (the template is called "Windows Phone Silverlight" as opposed to "Windows Phone") the namespace in question is available.

Simple Answer: System.Net.Sockets is not supported on Windows Phone 8.1

Use Windows.Networking.Sockets instead. Documentation available here: https://msdn.microsoft.com/de-de/library/windows/apps/windows.networking.sockets.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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