Uwe Keim
Uwe Keim

Reputation: 40736

Is it possible to use ASP.NET Core Web API without IIS in a Windows Desktop application?

Currently I'm trying to find a way to build a desktop app that hosts a browser window and uses JavaScript to communicate with a local ASP.NET Core Web API as the "backend":

enter image description here

All my searches lead to the suggestion that I should use IIS Express web server.

Unfortunately, IIS Express does not fit into my scenario, since I want the whole application to be installable and runnable by non-admin users.

Since IIS Express requires administrative permissions to install, this is out-of-scope to me.

My question:

Is there another way beside using IIS Express to run an ASP.NET Core Web API project?

I've read about the Kestrel server which seems to be what I am looking for, but I still don't get the big picture here.

Edit 1:

I've asked a somewhat releated question over at SE Software Recommendations.

Upvotes: 10

Views: 10310

Answers (2)

Aron
Aron

Reputation: 15772

To add to DavidG's answer.

Kestral is the correct solution IFF you want to run ASP.Net without IIS.

However this requires an open TCP port to work. Meaning that if you try to bind Kestral to port 80, AND the user has IIS installed. Kestral will fail to run.

You can get around this by using Katana to bind your website to a subdirectory within IIS. Unfortunately, this will often require Admin Rights.

Overall, you can basically use any OWIN server you want.

You can even put in some code to choose which OWIN server you use, based on the circumstances.

Upvotes: -1

DavidG
DavidG

Reputation: 118937

I'm sure Kestrel will work well for you in this situation. It's a cross platform web server which is based on libuv which means it is super fast. The official benchmarks show just how much it outperforms standard IIS.

Upvotes: 6

Related Questions