ASP.NET Core 2为非托管代码,为何仍提供.NET Core Runtime下载?
Great question! This is a really common point of confusion when moving from traditional .NET Framework-based ASP.NET to ASP.NET Core, so let's unpack this step by step to clear things up.
为什么IIS应用池要设置为「Not managed code」?
ASP.NET Core 2 was built to be cross-platform and runs independently of IIS's built-in CLR (Common Language Runtime)—the same runtime that powers classic ASP.NET apps built on .NET Framework.
When hosting an ASP.NET Core 2 app on IIS, IIS acts as a reverse proxy instead of directly hosting your code. It simply forwards incoming HTTP requests to the Kestrel web server that's embedded in your ASP.NET Core application. Since IIS isn't responsible for executing your app's .NET Core code, there's no need to enable managed code support in the application pool—that's why we set it to「Not managed code」.
那为什么还存在.NET Core Runtime 2.0.6可供下载?
Here's the key distinction: we're separating what IIS does from what your ASP.NET Core app needs to run.
While IIS doesn't use its own CLR for your app, your ASP.NET Core 2 application absolutely requires the .NET Core Runtime to execute its code. The runtime provides the core execution environment, essential libraries, and services (like garbage collection, type system handling, and framework API access) that your app depends on to start up and process requests. When you install this runtime on your server, it's what powers your ASP.NET Core app behind the scenes—even though IIS is just passing requests along to it.
To put it in simple terms:
- IIS is like a traffic controller, directing incoming requests to your app
- The .NET Core Runtime is the engine that makes your app run and handle those requests
内容的提问来源于stack exchange,提问作者Simon

