【发布时间】:2012-07-15 19:47:49
【问题描述】:
我正在训练我的 web.config 以识别最佳默认文件是什么。根据我的主人的说法,它应该如下面的清单所示。
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<appSettings/>
<system.web>
<defaultDocument>
<files>
<clear />
<add value="Defalut.aspx" />
</files>
</defaultDocument>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime/>
<pages controlRenderingCompatibilityVersion="4.0"/>
<machineKey/>
<customErrors defaultRedirect="Error.aspx" mode="On"/>
</system.web>
</configuration>
问题在于 VS2012 (Express) 将其标记为蓝色并声明主题中的错误。首先我认为我可以按原样上传它并通过蛮力使服务器喜欢该文件,但它随后生气并吐出以下内容
HTTP 错误 500.19 - 内部服务器错误 请求的页面无法访问,因为该页面的相关配置数据无效。
当我阅读错误消息时,它说:“无法读取配置部分'defaultDocument',因为它缺少部分声明。”
我已经完成了我的作业并找到了下面的文章,但由于我的情况限制(例如我需要手动上传 web.config 文件并且我无法在我的托管公司的服务器上运行任何脚本) , 没用。
如何解决这个小问题?
【问题讨论】:
标签: asp.net web-config asp.net-4.0 visual-studio-2012