asp.net – 如果我没有指定targetFramework =“4.0”会发生什么?

在我的ASP.Net 4.0 web.config我有以下属性
<compilation targetFramework="4.0">

如果我删除targetFramework属性,一切似乎正常进行.这个属性在什么情况下帮助我?

解决方法

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.

所以基本上如果你的应用程序池在IIS中的目标ASP.NET 4.0和你省略这个属性什么也没有发生=>您的网站仍然使用.NET 4.0

相关文章

这篇文章主要讲解了“WPF如何实现带筛选功能的DataGrid”,文...
本篇内容介绍了“基于WPF如何实现3D画廊动画效果”的有关知识...
Some samples are below for ASP.Net web form controls:(fr...
问题描述: 对于未定义为 System.String 的列,唯一有效的值...
最近用到了CalendarExtender,结果不知道为什么发生了错位,...
ASP.NET 2.0 page lifecyle ASP.NET 2.0 event sequence cha...