在ASP.Net Core中设置(或不设置).NET CLR版本的效果如何? [英] What is the effect of setting (or not) .NET CLR version in ASP.Net Core?

查看:216
本文介绍了在ASP.Net Core中设置(或不设置).NET CLR版本的效果如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为IIS Asp.NET Core应用程序池设置无托管代码" .NET CLR版本有什么意义?

What is the point of setting "No Managed Code" .NET CLR version for an IIS Asp.NET Core application pool?

文档

ASP.NET Core在单独的进程中运行,并管理运行时. ASP.NET Core不依赖于加载桌面CLR.设定.NET 将CLR版本更改为无托管代码"是可选.

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.

由于它是可选,因此保留默认的 v4.0 有什么弊端?为什么文档明确指示将其设置为无托管代码"?尚不清楚此特定配置是否存在性能问题.

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.

推荐答案

当您为应用程序池指定.NET CLR版本为4.0时,IIS尝试将一些ASP.NET支持库(如aspnet_isapi.dll)加载到其工作进程中.用于经典管道模式,而webengine4.dll用于集成模式).这样会增加内存使用量和攻击面,并且可能还会产生其他影响.

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.

因此,如果仅运行非ASP.NET 4.x应用程序(PHP,ASP.NET Core等),则可以设置无托管代码"来消除所有麻烦.

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.

这篇关于在ASP.Net Core中设置(或不设置).NET CLR版本的效果如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆