在Azure上托管Web服务时应用程序中的服务器错误

时间:2017-10-28 04:32:14

标签: c# asp.net azure hosting azure-web-app-service

我正在尝试托管在Azure上的ASP.NET中完成的Web服务。我设法让首页正确显示,但是,当我点击按钮指向另一个页面时,它会给我以下错误:

enter image description here

我尝试在web.config,web.debug.config和web.release.config中添加以下代码:

<customErrors mode="Off"/>

我还尝试在web.debug.config和web.release.config中取消注释以下内容,但它不起作用:

<customErrors defaultRedirect="GenericError.htm"
        mode="On" xdt:Transform="Replace">
        <error statusCode="500" redirect="InternalError.htm"/>
      </customErrors>

但是,当我在localhost上运行它时,我不会遇到错误。

任何人都可以帮忙吗?一直尝试调试它已经有一段时间了,我尝试过跟踪在线资源但仍然遇到同样的错误。

1 个答案:

答案 0 :(得分:0)

从您提到的屏幕截图中,它只是常见信息。您可以按照Troubleshoot a web app in Azure App Service using Visual Studio文档进行问题排查。例如在Web.config文件或remoting debug webApps等中添加自定义错误

enter image description here

enter image description here

enter image description here