简体   繁体   中英

Whats the relationship between ASP.NET Core, Kestrel and IIS?

When I create a new project in Visual Studio using the "ASP Net Core Web Application" template, and press F5 (or click the "IIS Express" debug button), what exactly is happening in the background in terms of web servers?

  1. Does it start an IIS webserver as reverse proxy with a kestrel application server which serves my app (I guess so)?
  2. Can I / How can I run the app without IIS (only using Kestrel)?
  3. Why can't I access my data when I use localhost:5000 (default Kestrel port) instead of localhost:63152 (IIS port)? Shouldn't I be able to access Kestrel directly, even if IIS serves as a proxy?
  4. When I dockerize the app with the default container mcr.microsoft.com/dotnet/core/sdk:3.1 and run it, does this also start an IIS + Kestrel inside the container?
  1. The IIS express will run like you say as a proxy in front of the kestrel process. In earlier versions of.Net IIS would also run the application but now that is handled by kestrel.

  2. In your project you will have (else you can create it) a folder called Properties with a file called launchSettings.json where you can specify profiles for how you want to run your project. In most cases this will be created when you create a new project in VS. Here you can add or modify profiles.

To run your project without IIS express your profile should have "commandName": "Project" . You can then choose what profile to run using the interface of VS.

  1. Im not entirely sure why you cant access this.

  2. That depends on your docker file but if you use the standard file it will not use IIS.

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