What is the difference between compilation and httpRuntime configuration properties?

3

I'm going through some problems while learning to work with C #, more specifically with Asp Net MVC.

I saw a configuration snippet in Web.config that left me a bit confused, namely:

<compilation debug="true" targetFramework="4.6.2"/>
<httpRuntime targetFramework="4.5"/>

As you can see, it looks like each one has targetFramework different settings.

I'd like to know:

  • What is the difference between compilation and httpRuntime ?
  • What does each of these settings affect, in the case of the targetFramework ?
asked by anonymous 21.07.2018 / 15:44

1 answer

1

As already replied by @Tetsuya Yamamoto in another question, briefly this is it:

The compilation selects which version of the .NET Framework reference assemblies is used when performing the build.

And httpRuntime to say that the current project is designed to use .NET 4.5 runtime assemblies without recompiling existing project assemblies on the deployment machine before loading it into memory.

The targetFramework no web.config serves to maintain compatibility issues between changes in each version of the .NET Framework. And the difference between targetFramework in compilation and httpRuntime belongs to each development and deployment environment.

    
21.07.2018 / 16:43