asp.net – web.config allowDefinition = MachineToApplication
发布时间:2020-12-16 04:17:55 所属栏目:asp.Net 来源:网络整理
导读:在根目录下,我有以下结构 ......web.configReport Folder- Login.aspx- Web.config | |- ViewReport | |- Report.aspx 在Report文件夹中的web.config文件中,我有以下内容: ?xml version="1.0"? configuration system.web authentication mode="Forms" forms
在根目录下,我有以下结构
.. .. .. web.config Report Folder - Login.aspx - Web.config | |-> ViewReport | |-> Report.aspx 在Report文件夹中的web.config文件中,我有以下内容: <?xml version="1.0"?> <configuration> <system.web> <authentication mode="Forms"> <forms loginUrl="Login.aspx" defaultUrl="ViewReport/Report.aspx"> <credentials passwordFormat="Clear"> <user name="Johl" password="pass888"/> </credentials> </forms> </authentication> </system.web> <location path="ViewReport/Report.aspx"> <system.web> <authorization> <allow users="Johl"/> <deny users="*"/> </authorization> </system.web> </location> </configuration> 当我开始调试时,我收到以下消息: 在应用程序级别之外使用注册为allowDefinition =’MachineToApplication’的部分是错误的.此错误可能是由于未在IIS中将虚拟目录配置为应用程序引起的. 请注意,在我的根web.config中,我有以下内容: 在我的根目录中,我已经拥有以下内容: <system.web> <authentication mode="Forms"> <forms loginUrl="Str/StrUserLogin.aspx" timeout="2880" slidingExpiration="true" /> </authentication> <authorization> <allow users="*" /> </authorization> </system.web> 解决方法
在站点根目录创建虚拟目录.这可以通过Web选项卡下的VS中的项目属性来完成.
您也可能在子目录中定义了应该位于根配置文件中的内容.看到类似的问题: Error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc-5 – MVC AttributeRoute似乎忽略了RoutePrefi
- asp.net – 如果页面上有异常,则输出缓存无效
- 如何在ASP.NET中绘制折线图
- asp.net – 如何在WebAPI中获取POST数据?
- asp.net – 为什么在添加新的响应标头时会出现“平台不支持
- asp.net – 如何在IIS7上全局设置enableVersionHeader为fal
- .net core 3.0web_razor page项目_使用中间件接受大文件上传
- ASP.NET – 如何有效地使用设计模式而不需要过度工程!
- asp.net页面间传值的五种方法
- Asp.Net MVC 5 Owin Twitter Auth throwing 401 Exception