Reputation: 471
I'm working on a personal project with VS 2015/Universal app solution and i try to follow this code sample :
Asynchronous Server Socket Example
But when i want to create a new IPHostEntry
or make a Dns.GetHostName()
VS don't find the assembly.
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 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.
Upvotes: 2
Views: 2556
Reputation: 10418
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.
Take a look at these pages for more details:
.NET for Windows Store apps overview
System.Net namespaces for UWP apps
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
Upvotes: 2