views:

414

answers:

1

In my ASP.Net 4.0 web.config I had the following attribute:

<compilation targetFramework="4.0">

If I remove the targetFramework attribute, everything appears to carry on as normal. Under what circumstances does this attribute help me?

+4  A: 

Quote from the doc:

Specifies the version of the .NET Framework that the Web site targets.

The default is Null.

If this attribute is omitted, the target version is determined by other settings in the Web.config file and by the IIS application pool that the Web site is associated with. For more information, see CompilationSection.TargetFramework and .NET Framework Multi-Targeting for ASP.NET Web Projects.

So basically if your application pool in IIS targets ASP.NET 4.0 and you omit this attribute nothing happens => your site still uses .NET 4.0

Darin Dimitrov