简体   繁体   English

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

[英]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 中有一个适用于 UWPStreamSocket 示例

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

相关问题 无法在通用Windows App中引用所有文件夹 - Can't reference all folders in universal Windows App Windows Universal无法在C#中引用XAML控件? - Windows Universal Can't Reference XAML Control in C#? 在添加参考中找不到mscomctllib - Can't find mscomctllib in add reference 在MSV C#2010 Express Edtn的“添加引用”窗口中找不到引用Tao.OpenGl和Tao.Platform.Windows - Can't find reference Tao.OpenGl and Tao.Platform.Windows in Add reference window in MSV C# 2010 Express Edtn 将System.Web参考添加到Windows 10 Universal App - Add System.Web Reference To A Windows 10 Universal App 找不到Windows Phone 8语音识别参考 - Can't find Windows Phone 8 speech recognition reference 我无法将WCF参考添加到Windows Mobile项目吗? - I can't add WCF reference to windows mobile project? 无法找到System.Data.Entity.DbContext作为引用添加 - System.Data.Entity.DbContext can't find to add as a reference 无法添加对.NET可移植类库的引用 - Can't add reference to .NET Portable Class Library 将通用Windows C#类库引用添加到通用Windows C ++ DLL项目Visual Studio 2015 - Adding a Universal Windows C# Class Library reference to a Universal Windows C++ DLL project Visual Studio 2015
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM