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

dawei

【声明】:唐山站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。