关于“Parser Error Message”

chiuyn 2003-06-09 05:14:06
今天不幸的使用了一下ASP.NET中的基于窗体的身份验证,出了这么个错误“Parser Error Message: It is an error to use a section registered allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.”立时头大:什么意思?没有虚拟目录,简直就是开玩笑。到MSDN里看了一把,有对症的解释:
微软中国是这么翻译的--
http://www.microsoft.com/china/TechNet/columns/insider/iisi0103.asp

“语法分析程序错误消息”具有何种含义?


问:我拥有一台装有最新补丁程序的IIS 5服务器,这台服务器总是收到内容为“语法分析程序错误消息:这是一个由于在应用程序层上使用注册为allowDefinition=‘MachineToApplication’的部分所导致的错误。这个错误可能是由一个在IIS中未被配置为应用程序的虚拟目录所造成的。”的出错信息。请问这是为什么?

答:我喜欢这些内容详细的ASP.NET错误消息!它们不仅描述了出现问题的原因,同时还经常为您提供解决方案。如果您的ASP.NET应用程序被配置为需要使用那些在元数据库定义好的“应用程序”的特性(如或),而这些“应用程序”定义又不存在,那么,您将看到这条出错信息。您可以通过从web.config文件中删除相关设置或分别在Web站点、虚拟目录或目录的“主目录”、“虚拟目录”和“目录”属性选项卡上点击“创建”按钮的方式纠正这种错误。为执行上述操作,您至少需要具备针对上述位置的脚本执行权限和读取权限。

完全不明白,我简直想骂翻译的人猪头!微软的英文网站是这么说的--

http://www.microsoft.com/technet/treeview/default.asp?url=/technet/columns/insider/iisi0103.asp

What Does The “Parser Error Message” Mean?

Q: We have a fully patched IIS 5 server and are receiving the following error “Parser Error Message: It is an error to use a section registered allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.” Can you explain what this means?

A: I love these verbose Asp.net error messages! They often direct you to the solution as well as describe the problem. You’ll see this error when your Asp.net application is configured such that it uses a feature like <authentication mode../> or <sessionState..> that requires an “Application” be defined in the metabase, and that definition is missing. You can correct this by either removing such settings from your web.config files, or by clicking “Create” on the Home Directory, Virtual Directory, or Directory properties tab of a web site, virtual directory, or directory, respectively. This location will require at least the Scripts Only permission and Read permissions as well.

感觉有点关系,但还是不明白。最后在http://www.csharpfriends.com/Forums/ShowPost.aspx?PostID=7256看到了曙光,试了一把,果然:
对于authentication mode../>或者<sessionState..>的设置,应当在虚拟目录的根目录下设置,所有子目录的设置不能与之冲突。

虽然浪费了不少时间,毕竟还是解决了问题。希望有助于各位看官。
...全文
1389 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
saiyang0312 2003-06-09
  • 打赏
  • 举报
回复
好人,我收藏一下

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧