2

我了解所有.net 4.x.x发布版本均已就地升级。我已经阅读了帖子类似的 SO 问题,但我仍然不完全了解应用程序中以下两个配置设置上下文中的应用程序运行时行为:

<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功能并且更愿意运行在怪癖模式下。

4

0 回答 0