Is it possible to run locally asp net core with kestrel or an httplistener in uw

Running ASP.NET Core Locally with Kestrel or HttpListener in UWP

ASP.NET Core is a powerful and versatile programming language that allows to build web applications and services. One question that arises is it is to run ASP.NET Core locally Kestrel or an HttpListener in Windows Platform (UWP).

The answer is yes, it is indeed possible to run ASP.NET Core locally with Kestrel or an HttpListener in UWP. Let's explore how to achieve this.

Using Kestrel in UWP

Kestrel is a cross-platform web server that is included by default in ASP.NET Core. To use Kestrel in UWP, you need to follow steps:

  1. Create a new UWP project in Visual Studio.
  2. Add the necessary NuGet for ASP.NET Core and Kestrel.
  3. In the UWP project, open the Program.cs file and modify the CreateHostBuilder method to configure Kestrel as the web server.

With this configuration, Kestrel will be used as the web server for your ASP.NET Core application in UWP.

Using HttpListener in UWP

If you prefer to use HttpListener instead of Kestrel in UWP, you can do so by following these steps:

  1. Create a new UWP project in Visual Studio.
  2. Add the necessary NuGet packages for ASP.NET Core.
  3. In the UWP project, open the Program.cs file and modify the CreateHostBuilder method to configure HttpListener as the web server.

By configuring HttpListener as the web server, your ASP.NET Core application in UWP will use HttpListener to incoming requests.

Conclusion

In conclusion, it is possible to run ASP.NET Core locally with Kestrel or an HttpListener in UWP. By following the steps outlined above, you can configure either Kestrel or HttpListener as the web server for your ASP.NET Core application in UWP.

Remember to add the necessary NuGet packages and modify the CreateHostBuilder method in the Program.cs file to configure the desired web server.

Now you have the knowledge to run ASP.NET Core locally in UWP using Kestrel or an HttpListener. Happy !

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents