Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Purpose of Runtime section in Web.config

Tags:

asp.net

wcf

When closely observing Web.config, all the possible child elements of <configuration> are also present inside configuration/runtime.

I have never encountered a need to specify values in configuration/runtime section. Have you come across this situation?

What is the purpose of specifying values in runtime section ?

like image 662
Abhijeet Avatar asked Oct 21 '12 15:10

Abhijeet


2 Answers

The purpose of <configuration><Runtime> settings as described in msdn here is

"Runtime settings specify how the common language runtime handles garbage collection and the version of an assembly to use in configuration files."

These are CLR settings that you can configure for your application. The possible settings directly under <configuration> is the not the same as <configuration><Runtime>. You can refer to the <configuration> schema here

like image 166
Praburaj Avatar answered Oct 03 '22 06:10

Praburaj


To add to above reply i did face real time situation to use "runtime" element for configuring Assembly binding. I was using Ninject which was referring to System.Web.MVC 3.0.0.0 while i was having System.Web.MVC with version 5.0.0.0

This was causing IOFileNotFound exception

By Adding "runtime" binding i could redirect any binding for System.Web.MVC to 5.0.0.0 verison.

like image 43
Vikas Sharma Avatar answered Oct 03 '22 06:10

Vikas Sharma