繁体   English   中英

找不到类/添加引用通用窗口

[英]Can't find class/add reference universal windows

我正在使用 VS 2015/Universal 应用程序解决方案进行个人项目,我尝试遵循以下代码示例:

异步服务器套接字示例

但是当我想创建一个新的IPHostEntry或创建一个Dns.GetHostName() VS 找不到程序集。

我的解决方案资源管理器中有这些参考资料:

Analyzer
Microsoft.ApplicationInsights
Microsoft.ApplicationInsights.PersistenceChannel
Microsoft.ApplicationInsights.WindowsApps
Microsoft.NETCore.UniversalWindowsPlatform
Universal Windows

和 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;

我还尝试将System.Net dll手动添加到解决方案引用中(位于 C:\\已经由生成系统自动添加。

Windows 应用商店应用程序使用不同版本的 .Net 框架,其中不包含“常规”.Net 框架的许多类,某些缺失类的功能可能会在不同的命名空间和类型下提供。

请查看这些页面以了解更多详细信息:

.NET for Windows Store 应用程序概述

UWP 应用的 System.Net 命名空间

在我看来,您尝试使用的接口和方法不可用。

从评论中编辑: MSDN 中有一个适用于 UWPStreamSocket 示例

暂无
暂无

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

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