In this article, we will see how we can embed a web server inside a desktop application. This is done using asp.net core and a WPF application, but the same experience can be ported to a Windows Form or console application without any big difference. This is a very unusual scenario, as we usually have a client that connects to the API, and both are in a different place. Anyway, there are situations where integrating a visual UI with a web server to a client may be useful. I’m thinking about embedded devices that have to be controlled remotely or a workstation that wants to share data, but I’m sure you have more imagination than me and you already found more interesting use cases 😃
For example, I used this situation for creating jSOS, a general-purpose API system for extending javascript capabilities, for example adding direct printing or file system access. The result is hosted on Github and it is a fully working application. Curios? Well, I will use this project as a use case to explain how to configure a WPF application for acting as a webserver!
Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.