问题
What is the point of setting "No Managed Code" .NET CLR version for an IIS Asp.NET Core application pool?
Documentation says that
ASP.NET Core runs in a separate process and manages the runtime. ASP.NET Core doesn't rely on loading the desktop CLR. Setting the .NET CLR version to No Managed Code is optional.
Since it is optional, what are the drawbacks of keeping the default v4.0? Why the documentation explicitly instructs to set it to "No Managed Code"? It's not very clear whether there are performance concerns around this particular configuration.
回答1:
When you specify .NET CLR version as 4.0 for an application pool, IIS tried to load into its worker processes some ASP.NET supporting libraries (like aspnet_isapi.dll
for classic pipeline mode, and webengine4.dll
for integrated mode). Such increases memory usage and attack surface, and might also have other impact.
Therefore, if you only run non-ASP.NET 4.x apps (PHP, ASP.NET Core and so on), you can set "No Managed Code" to remove all the troubles.
来源:https://stackoverflow.com/questions/49185512/what-is-the-effect-of-setting-or-not-net-clr-version-in-asp-net-core