Web.Config的System.Web部分中的AllowLocation =" true"有什么作用?

时间:2020-03-06 14:45:17  来源:igfitidea点击:

我们有一个.NET 2.0应用程序,该应用程序通常在IIS6上运行,并且以前在IIS7上运行良好,但是最近在为Vista安装SP1之后,IIS7似乎在Web.Config文件中的一行上令人窒息:

<system.web AllowLocation="true">

删除AllowLocation属性是否安全?此属性有什么作用?

解决方案

将此设置为true应该可以在web.config中启用任何&lt;location>部分,因此,如果其中没有任何内容,则可以删除它。

从MSDN:

When set to false, the AllowLocation property indicates that the section is accessed by native-code readers. Therefore, the use of the location attribute is not allowed, because the native-code readers do not support the concept of location.

默认值为true,因此我们应该可以删除它,而不会影响应用程序。