.Net Framework Web.Config Compilation and httpRuntime TargetFramework Best Practices

Viewed 38

I am upgrading some .Net Framework projects to .Net Framework 4.8 in MSVS.

When I alter the project properties to set the Application target framework to ".Net Framework 4.8" the Compilation TargetFramework setting gets altered but the httpRuntime TargetFramework does not.

In some projects the httpRuntime TargetFramework is not even set.

I've therefore been trying to work out if I need to alter the runtime setting separately.

For clarity the elements and attributes I am looking that are those in the system.web section of the web.config as shown below.

<system.web>
    <compilation targetFramework="4.8" />
    <httpRuntime targetFramework="4.5" />
</system.web>

I understand the purpose and difference of these settings is that it is to iron out quirks but I can't see anything about best practices.

What I am trying to work out why that would be necessary as surely a requirement for any installation would be to have the version, against which the code was compiled, in the environment into which it is being deployed?

If code is compiled in one version but deployed into an environment where that version is not installed doesn't that render all testing obsolete?

When is the httpRuntime TargetFramework value set and when is it not?

If the httpRuntime TargetFramework is not set what is the default behaviour?

Are there a corresponding values in .Net Core/.Net 6?

Thanks in advance to anyone who contributes to this.

0 Answers
Related