在我的ASP.Net 4.0 web.config我有以下属性:
<compilation targetFramework="4.0">
解决方法
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