简体   繁体   English

如何清除此Web配置错误,在本地主机上工作正常,但如果我在服务器上上传,则会发生Errror

[英]How To remove This Web config error, It works Fine on local host but if i uploaded on the server then Errror occured

This is my Web.config File......Following is the error 这是我的Web.config文件……以下是错误

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. 但是,可以由运行在本地服务器计算机上的浏览器查看它。

<?xml version="1.0"?>  
<configuration>
  <appSettings>
     <add key="SqlCon" value="Data Source=173.192.89.445;Initial Catalog=Rent_Driver; user
  </appSettings>
<location path="driversonrent.com" allowOverride="true">
 <system.web>
  <customErrors mode="Off" />
  <roleManager enabled="true"/>
  <compilation debug="true" targetFramework="4.0">
    <assemblies>
      <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
      <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      <add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      <add assembly="System.Web.DynamicData.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </assemblies>
  </compilation>
  <authentication mode="None">
    <forms name="Loginnew" path="/" loginUrl="Loginnew.aspx" protection="Validation" timeout="30"></forms>
  </authentication>
  <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"/>
</system.web>

在此处添加〜:path =“〜/”或在login.aspx之前,以使服务器采用相对路径。

Although the previous answer is technically correct (and acceptable) but it's normally not a good practice to show raw errors to remote users from your production server as they could potentially contain sensitive information and are a put-off to general public. 尽管上一个答案在技术上是正确的(并且可以接受),但是通常不是从生产服务器向远程用户显示原始错误的好习惯,因为这些错误可能包含敏感信息,并且容易受到公众的欢迎。

You might be better off by: 您可能会受益于:

  1. Making a custom error page and handling displaying graceful error message to the users. 制作自定义错误页面并处理向用户显示优美的错误消息。
  2. Logging errors to an external source (DB, text whatever) for later diagnosis. 将错误记录到外部源(数据库,无论输入什么文字),以便以后进行诊断。

There are a lot of articles out there to help you with this kind of implementation if that is what you require. 如果您需要的话,有很多文章可以帮助您实现这种实现。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不在azure服务器上工作但在本地环境中工作正常吗? - Not working on azure server but works fine in local environment? 远程服务器返回错误:(401)我尝试通过Web客户端下载文件时发生未授权错误 - The remote server returned an error: (401) Unauthorized Error occured when i try to download file via Web Client Twilio SMS 无法通过部署到 Web 服务器的 ASP.NET MVC C# web 工作(但在本地测试环境中工作正常) - Twilio SMS not working via ASP.NET MVC C# web deployed to Web Server (but works fine in local test environment) 如何通过删除服务器信息 <customHeaders> 在web.config中 - how to remove server info via <customHeaders> in web.config RestSharp可在localhost上运行,但在上载到主机时返回错误 - RestSharp works on localhost, but returns an error when uploaded to host Web API(Rest)在本地主机中工作,但在服务器中不工作 - Web API (Rest) working in local host but not in server 在 AWS 上部署 blazor 服务器应用程序“错误:如果连接不在‘已连接’State 中,则无法发送数据。” 但适用于本地主机 - Deployed blazor server app on AWS “Error: Cannot send data if the connection is not in the 'Connected' State.” But works on local host 我如何在本地环境中工作的托管环境中删除Cookie? - How to remove cookie in Hosted environment, which i works in local environment? Ajax自动完成CSS在iis和服务器上工作正常,但在本地计算机上工作不正常 - Ajax Auto complete Css works fine in iis and the server but not in local machine 在服务器中获取“索引超出数组范围”异常,本地工作正常 - Getting “Index was outside the bounds of the array” exception in server, local works fine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM