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

Server Error in Application when hosting Web Service on Azure

我正在尝试在 Azure 上托管我在 ASP.NET 中完成的 Web 服务。我设法使首页正确显示,但是,当我单击一个按钮转到另一个页面时,出现以下错误:

我尝试在 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>

然而,当我 运行 在本地主机上时,我没有遇到错误。

有人可以帮忙吗?已经尝试调试它很长一段时间了,我已经尝试使用在线资源,但仍然遇到相同的错误。

从你提到的屏幕截图来看,它只是常见的信息。可以关注Troubleshoot a web app in Azure App Service using Visual Studio document to troubleshoot. Such as add custom error off in the Web.config file or remoting debug webApps