<compilation targetFramework =“ 4.x.x” />和<httpRuntime targetFramework =“ 4.y.y” />如何一起工作?

我了解所有.net 4.x.x个发行版本均已到位升级。我已经读过postsimilar SO question,但是在我的应用程序中以下两个配置设置的上下文中,我仍然不完全了解应用程序运行时行为:

<compilation debug="true" targetFramework="4.x.x" />
<httpruntime targetFramework="4.y.y" />

我了解到,设置<httpruntime targetFramework="4.y.y" />只是一种简短形式,它实际上扩展为以下设置:

<compilation targetFramework="" />
<machineKey compatibilityMode="" />
<pages controlRenderingCompatibilityVersion="" />

假设以上对我的理解是正确的,我想验证一下并清除以下疑问:

如果<compilation targetFramework />设置已经存在,那么我认为它会覆盖由于<httpruntime targetFramework />而生成的设置

例如,如果我的web.config中同时存在以下两个设置:

<compilation debug="true" targetFramework="4.6.1" />
<httpruntime targetFramework="4.7.2" />

然后对运行时有效意味着:

<compilation targetFramework="4.6.1" />
<machineKey compatibilityMode="" />
<pages controlRenderingCompatibilityVersion="" />

我发现很难理解上面的设置告诉运行时应用程序是针对4.6.1进行编译的,但是我想利用目标计算机上安装的.net框架的功能(例如4.7.2)或什么设置可以告诉运行时该应用程序不希望利用4.7.2功能,而是希望在怪异模式下运行。

annalamiya 回答:<compilation targetFramework =“ 4.x.x” />和<httpRuntime targetFramework =“ 4.y.y” />如何一起工作?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2564009.html

大家都在问