简体   繁体   中英

Is there a HttpListener in UWP?

I am working in UWP and I can't use the HttpListener class from the System API. Is there a new feature in the Windows API?

is there a new feauture in the Windows API?

Not all .NET APIs are supported in UWP app. You could check .NET for UWP apps to see all supported .NET APIs in UWP.

In your case, you should be looking at: StreamSocketListener in Windows.Networking.Sockets Namespace . You could use StreamSocketListener to make a similar httplistener by yourself.

It's included in .NET Standard 2.0. Scroll to the bottom of the documentation page for HttpListener to see what versions of .NET include it: https://learn.microsoft.com/en-us/dotnet/api/system.net.httplistener?view=netstandard-2.1#applies-to

.NET standard 2.0 is included in Windows build 10.0.16299. What versions of .NET Standard is included in what build of Windows can be seen here: https://learn.microsoft.com/en-us/dotnet/standard/net-standard.net-implementation-support

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