当前位置:编程学习 > C#/ASP.NET >>

我的Web.config文件 运行时错误

<configuration>
<configSections>
<section name="codeHighlighter" requirePermission="false" type="ActiproSoftware.CodeHighlighter.CodeHighlighterConfigurationSectionHandler,ActiproSoftware.CodeHighlighter.Net20"/>
</configSections>
<location path="Admin">
<system.web>
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="de-DE"/>
<httpRuntime maxRequestLength="100000" />
</system.web>
</location>
<location path="Code/Diy.aspx">
<system.web>
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="de-DE"/>
</system.web>
</location>
<system.web>
<!--调试用标记-->
<!--
    <customErrors mode="Off"/>
    -->
  <customErrors mode="Off">
<error statusCode="404" redirect="404.htm"/>
</customErrors>
<pages theme="Skin" validateRequest="false" enableEventValidation="false"/>
<globalization fileEncoding="GB2312" requestEncoding="GB2312" responseEncoding="GB2312" culture="zh-CN" uiCulture="zh-CN"/>
<!-- 
    
                
<globalization fileEncoding="GB2312" requestEncoding="GB2312" responseEncoding="GB2312" culture="zh-CN"/>

          <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="de-DE" />
      设置 compilation debug="true" 可将调试符号插入
            已编译的页面中。但由于这会 
            影响性能,因此只在开发过程中将此值 
            设置为 true。
        -->
<compilation debug="false">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
            通过 <authentication> 节可以配置 ASP.NET 用来 
            识别进入用户的
            安全身份验证模式。 
        -->
<authentication mode="Windows"/>
<!--
            如果在执行请求的过程中出现未处理的错误,
            则通过 <customErrors> 节可以配置相应的处理步骤。。

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
</system.web>
<codeHighlighter>
<cache languageTimeout="3"/>
<keywordLinking enabled="true" target="_blank" defaultKeywordCollectionKey="ActiproKeywords">
<keywordCollection key="ActiproKeywords">
<explicitKeyword tokenKey="IdentifierToken" patternValue="Actipro" url="http://www.actiprosoftware.com" caseSensitive="false"/>
<explicitKeyword tokenKey="IdentifierToken" patternValue="CodeHighlighter" url="http://www.codehighlighter.com" caseSensitive="false"/>
</keywordCollection>
</keywordLinking>
<languages>
<language key="Assembly" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.Assembly.xml"/>
<language key="BatchFile" definitionPath="~/Languages/Lexers/ActiproSoftware.BatchFile.xml"/>
<language key="C#" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.CSharp.xml"/>
<language key="CSS" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.CSS.xml"/>
<language key="HTML" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.HTML.xml"/>
<language key="INIFile" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.INIFile.xml"/>
<language key="Java" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.Java.xml"/>
<language key="JScript" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.JScript.xml"/>
<language key="Lua" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.Lua.xml"/>
<language key="MSIL" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.MSIL.xml"/>
<language key="Pascal" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.Pascal.xml"/>
<language key="Perl" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.Perl.xml"/>
<language key="PHP" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.PHP.xml"/>
<language key="PowerShell" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.PowerShell.xml"/>
<language key="Python" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.Python.xml"/>
<language key="SQL" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.SQL.xml"/>
<language key="VB.NET" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.VBDotNet.xml"/>
<language key="VBScript" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.VBScript.xml"/>
<language key="XAML" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.XAML.xml"/>
<language key="XML" definitionPath="~/fckeditor/editor/plugins/insertcode/Languages/Lexers/ActiproSoftware.XML.xml"/>
</languages>
<lineNumberMargin foreColor="Teal" paddingCharacter=" " visible="true"/>
<outlining enabled="true" imagesPath="~/fckeditor/editor/plugins/insertcode/Images/OutliningIndicators/"/>
<spacesInTabs count="4"/>
</codeHighlighter>
</configuration>



我是新手请问如何解决下面的问题?


运行时错误

说明: 服务器上出现应用程序错误。此应用程序的当前自定义错误设置禁止远程查看应用程序错误的详细信息(出于安全原因)。但可以通过在本地服务器计算机上运行的浏览器查看。 

详细信息: 若要使他人能够在远程计算机上查看此特定错误消息的详细信息,请在位于当前 Web 应用程序根目录下的“web.config”配置文件中创建一个 <customErrors> 标记。然后应将此 <customErrors> 标记的“mode”属性设置为“Off”。


<!-- Web.Config 配置文件 -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

注释: 通过修改应用程序的 <customErrors> 配置标记的“defaultRedirect”属性,使之指向自定义错误页的 URL,可以用自定义错误页替换所看到的当前错误页。


<!-- Web.Config 配置文件 -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>
--------------------编程问答-------------------- 神马意思哦 --------------------编程问答-------------------- 你的程序有问题

但由于WEB.CONFIGN的安全配置,远程无法查看到出错代码,和出错处


<configuration> 
        <system.web> 
                <customErrors   mode= "Off "/> 
        </system.web> 
</configuration> 


配置这个节点,就可以远程看到出错代码,然后再查看原因。 --------------------编程问答-------------------- 指定一下版本
选择网站名称-右击属性--ASP.NET查看版本。



--------------------编程问答-------------------- <customErrors   mode= "Off "/> 
改一下,看看哪儿出错 --------------------编程问答-------------------- 运行时错误 

说明:   服务器上出现应用程序错误。此应用程序的当前自定义错误设置禁止远程查看应用程序错误的详细信息(出于安全原因)。但可以通过在本地服务器计算机上运行的浏览器查看。   

详细信息:   若要使他人能够在远程计算机上查看此特定错误消息的详细信息,请在位于当前   Web   应用程序根目录下的“web.config”配置文件中创建一个   <customErrors>   标记。然后应将此   <customErrors>   标记的“mode”属性设置为“Off”。  


其实他已经给你答案啦,,你先把<customErrors mode= "Off "/> 改掉,然后调试 --------------------编程问答-------------------- 不是webconfig的错,是程序的问题。
浏览器提示这个是因为在webconfig里配置了客户端不显示详细的错误信息,所以才有这个提示,
就是为了要告诉你要想看到详细的错误信息,就要把webconfig李这个customErrors改了。 --------------------编程问答-------------------- 代码问题,web.config给你过滤掉了,请仔细找找代码上的问题
--------------------编程问答--------------------
引用 5 楼 sara_yhl 的回复:
运行时错误

说明:   服务器上出现应用程序错误。此应用程序的当前自定义错误设置禁止远程查看应用程序错误的详细信息(出于安全原因)。但可以通过在本地服务器计算机上运行的浏览器查看。

详细信息:   若要使他人能够在远程计算机上查看此特定错误消息的详细信息,请在位于当前   Web   应用程序根目录下的“web.config”配置文件中创建一个   <customErrors>   ……
那怎改呢?是改为: 
<customErrors Off="Off"/>
    -->
  <customErrors Off="Off">吗?
--------------------编程问答-------------------- 你在服务器上访问用localhost:就能看到真正的错误了 --------------------编程问答-------------------- 应该是程序有问题。。  --------------------编程问答--------------------
引用 9 楼 cf_nxcxy 的回复:
你在服务器上访问用localhost:就能看到真正的错误了
不明。具体怎弄、?谢谢 --------------------编程问答--------------------
引用 11 楼 amandavip 的回复:
引用 9 楼 cf_nxcxy 的回复:

你在服务器上访问用localhost:就能看到真正的错误了
不明。具体怎弄、?谢谢

远程连接到服务器,然后打开浏览器输入http://localhost:端口/网站目录/ --------------------编程问答-------------------- 补充一下,是在服务器的浏览器上
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,