Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is hosting outside of IIS termed as self host?

In general, if a third service provider manages the web server for me then it is hosted, while if I am by myself managing the web server then it is self-hosting.

In ASP.NET Core, In both places, I am the one who publishes the code on the server, at the time of IIS it is not called self-hosting? what exactly does "self" means?

For me as a programmer, self-hosting means the application should be able to host itself, which means it must be able to listen to the web requests directly or it must run on its own process. Am I wrong? Please someone help me to understand the meaning of "self" in self-hosting.

Also, the image Microsoft uses to explain self-host is very confusing to me, as far as I know, IIS uses w3wp.exe to execute the application as:

enter image description here

The above image is good, w3wp is the process within that our app executes and IIS is the overall container.

But now, look at this image:

enter image description here

Here the application is the wrapper and Kestrel is within the application and the process (dotnet.exe / application.exe) is the wrapper containing Kestrel, why is it so?

For me, it should be

enter image description here

Why is my image different from Microsoft's image for self-hosting? Where am I missing the concept?

like image 979
Bhavna Avatar asked Feb 03 '26 19:02

Bhavna


1 Answers

I think that you need to extend the concept:
Hosted is essentially an application (web app) exposed via a third party service that run a server (web server) for you.
Self hosted is the same application exposed via a server managed by you.

Sometimes, as correctly mention by Vineet, self hosted stands for an application with a server process exposing the application itself. Like Kestrel for Blazor.

IIS is not the discriminant for hosted or self-hosted, is just the base of the concept.

From my point of view when I use IIS Express integrated in Visual Studio debug, the application is self hosted and hosted at the same time.
Is hosted in IIS Express from a web server perspective and, at the same time, is self hosted from a service perspective.

Just for information: the applicationName.exe produced by the compiler for Blazor app is just a launcher based on Kestrel. Is a web server that launch the applicationname.dll

An example below from two total different application. The executable (you can open it with a binary editor) is the same.

enter image description here

like image 132
Nicola Biada Avatar answered Feb 05 '26 11:02

Nicola Biada



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!