简体   繁体   English

在Web.Config的System.Web部分中,AllowLocation =“ true”有什么作用?

[英]What does AllowLocation=“true” do in System.Web section of Web.Config?

We have a .NET 2.0 application which we normally run on IIS6, and used to run fine on IIS7, but recently after installing SP1 for Vista IIS7 seems to be choking on a line in the Web.Config file: 我们有一个.NET 2.0应用程序,该应用程序通常在IIS6上运行,并且过去在IIS7上运行良好,但是最近在为Vista安装SP1之后,IIS7似乎在Web.Config文件中的一行上令人窒息:

<system.web AllowLocation="true">

Is it safe to remove the AllowLocation attribute? 删除AllowLocation属性是否安全? What does this attribute do? 此属性有什么作用?

From MSDN: 从MSDN:

When set to false, the AllowLocation property indicates that the section is accessed by native-code readers. 设置为false时,AllowLocation属性指示本机代码读取器访问此部分。 Therefore, the use of the location attribute is not allowed, because the native-code readers do not support the concept of location. 因此,不允许使用location属性,因为本机代码读取器不支持位置的概念。

The default value is true, so you should be able to remove it with no effect on your application. 默认值为true,因此您应该可以删除它,而不会影响您的应用程序。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM