How <compilation targetFramework = "4.x.x" /> and <httpRuntime targetFramework = "4.y.y" /> works together?

1.4k Views Asked by At

I understand all .net 4.x.x release versions are in place upgrade. I already read post and similar SO question but still I don’t fully understand application runtime behavior in context of below two configuration settings in my application :

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

I understand that setting <httpRuntime targetFramework="4.y.y" /> is just short form and it actually expands to below settings :

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

Assuming above understanding of mine is correct, I would like to validate same and clear below doubts :

If <compilation targetFramework /> setting is already there, then I assume it overrides the one generated because of <httpRuntime targetFramework />

For example, if both below settings below are present in my web.config :

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

Then effectively to runtime this means :

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

I am finding difficult to understand what setting above tells runtime that application is compiled against 4.6.1 but wants to leverage features of .net framework installed on target machine (say 4.7.2) OR what setting tells runtime that application does not want to leverage 4.7.2 features and would prefer to run under quirk mode.

0

There are 0 best solutions below