[英]Can't find class/add reference universal windows
I'm working on a personal project with VS 2015/Universal app solution and i try to follow this code sample :我正在使用 VS 2015/Universal 应用程序解决方案进行个人项目,我尝试遵循以下代码示例:
Asynchronous Server Socket Example异步服务器套接字示例
But when i want to create a new IPHostEntry
or make a Dns.GetHostName()
VS don't find the assembly.但是当我想创建一个新的
IPHostEntry
或创建一个Dns.GetHostName()
VS 找不到程序集。
I have these references on my solution explorer :我的解决方案资源管理器中有这些参考资料:
Analyzer
Microsoft.ApplicationInsights
Microsoft.ApplicationInsights.PersistenceChannel
Microsoft.ApplicationInsights.WindowsApps
Microsoft.NETCore.UniversalWindowsPlatform
Universal Windows
and the using directives following :和 using 指令如下:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
using System.Net.Sockets;
I tried also to add System.Net dll
manually (located in C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework.NETFramework\\v4.6) to the solution references but i got an error telling me that the component is already automatically added by the generation system.我还尝试将
System.Net dll
手动添加到解决方案引用中(位于 C:\\已经由生成系统自动添加。
Windows Store Apps use a different version of .Net framework, which does not contain many of the classes of the "regular" .Net framework, the functionality for some of the missing classes might be offered under a different namespace and type. Windows 应用商店应用程序使用不同版本的 .Net 框架,其中不包含“常规”.Net 框架的许多类,某些缺失类的功能可能会在不同的命名空间和类型下提供。
Take a look at these pages for more details:请查看这些页面以了解更多详细信息:
.NET for Windows Store apps overview .NET for Windows Store 应用程序概述
System.Net namespaces for UWP apps UWP 应用的 System.Net 命名空间
It seems to me that the interfaces and methods you are trying to use are not available.在我看来,您尝试使用的接口和方法不可用。
Edit from comments: There is a StreamSocket sample for UWP in MSDN从评论中编辑: MSDN 中有一个适用于 UWP的StreamSocket 示例
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.