Asp.net - <的customErrors模式="关闭" />试图访问工作网页时出错 [英] Asp.net - <customErrors mode="Off"/> error when trying to access working webpage

查看:1797
本文介绍了Asp.net - <的customErrors模式="关闭" />试图访问工作网页时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个asp.net网页,并已上载至网络服务器。然而,当我尝试远程查看网页,我得到的web.config文件中customerror标记错误。该页面没有错误或警告本地工作。另外,如果我上传网页作为一个.html文件,我可以远程精细查看它。
我已经看到了很多其他人有此错误的,但解决方案只是说改变的customErrors标记为关闭,这是我做,不工作,你知道有一个问题与网络服务器或者是什么可能是这里的问题?

以下是错误页面:


  

在'/'应用程序的服务器错误。
  运行时错误
  说明:服务器上出现应用程序错误。此应用程序prevent应用程序错误被细节>远程查看(出于安全原因)的当前自​​定义错误>设置。它可以,但是,可以通过在本地服务器计算机上运行的浏览器>浏览。


  
  

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


  
  

 <结构>
    <&的System.Web GT;
        <的customErrors模式=关/>
    < /system.web>
< /结构>


  

注:你看到可以用自定义错误页替换的当前错误页由>修改应用程序的>配置标记的defaultRedirect属性,使之指向自定义错误页的URL


  
  

 <结构>
    <&的System.Web GT;
        <的customErrors模式=仅限远程的defaultRedirect =mycustompage.htm/>
    < /system.web>
< /结构>

这里是我的web.config文件:

 <?XML版本=1.0&GT?;
<结构>  <&的System.Web GT;
    <的customErrors模式=关/>
  < /system.web>  <&的System.Web GT;
    <编译调试=真/>
    <身份验证模式=无/>
  < /system.web>
< /结构>


解决方案

您应该只有一个<&的System.Web GT; 在您的配置文件。
    
    

 <&的System.Web GT;
    <的customErrors模式=关/>
    <编译调试=真/>
    <身份验证模式=无/>
  < /system.web>
< /结构>

I have created an asp.net webpage and have uploaded it onto a webserver. However when I try to view the page remotely, I get errors about the customerror tag in the web.config file. The page works locally with no errors or warnings. Also if I upload the page as a .html file, I can view it fine remotely. I have seen a lot of other people with this error, but the 'solutions' just say to change the customErrors tag to 'Off', which I have done and does not work, do you know is there an issue with the webserver or what could be the problem here?

Here is the error page:

Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error >settings for this application prevent the details of the application error from being >viewed remotely (for security reasons). It could, however, be viewed by browsers running >on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote >machines, please create a tag within a "web.config" configuration file >located in the root directory of the current web application. This tag >should then have its "mode" attribute set to "Off".

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

Notes: The current error page you are seeing can be replaced by a custom error page by >modifying the "defaultRedirect" attribute of the application's >configuration tag to point to a custom error page URL.

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

And here is my web.config file:

<?xml version="1.0"?>
<configuration>

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

  <system.web>
    <compilation debug="true"/>
    <authentication mode="None"/>
  </system.web>
</configuration>

解决方案

You should only have one <system.web> in your config file.

  <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true"/>
    <authentication mode="None"/>
  </system.web>
</configuration>

这篇关于Asp.net - &LT;的customErrors模式=&QUOT;关闭&QUOT; /&GT;试图访问工作网页时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆