简体   繁体   English

将ASP.NET MVC应用程序部署到Azure时出错

[英]Error deploying ASP.NET MVC application to Azure

I am deploying my first ASP.NET MVC to Windows Azure. 我将第一个ASP.NET MVC部署到Windows Azure。 After deploying the site is working and also the links within. 部署后,该站点以及其中的链接均正常运行。 But hours later if I check the links again it shows the following error: 但是几个小时后,如果我再次检查链接,它将显示以下错误:

An error occurred while processing your request. 处理您的请求时发生错误。

I used the steps mentioned here . 我使用了这里提到的步骤。

Any idea what I am missing? 知道我缺少什么吗? Why is it working for hours and then throwing an error? 为什么要工作几个小时然后抛出错误?

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

This is the quick-and-dirty approach but it will at least get you the information you are looking for. 这是快速而又肮脏的方法,但至少会为您提供所需的信息。 Just be sure to turn custom errors back on when you are done. 只要确保完成后重新打开自定义错误即可。 NOTE: This method will display your stacktrace to the entire world. 注意:此方法将显示您的堆栈跟踪到整个世界。

In MVC this error will show if any exception will occur. 在MVC中,此错误将显示是否会发生任何异常。 You need to debug your code via enabling trace logs or by changing parameter in web.config file so it will display the exception. 您需要通过启用跟踪日志或更改web.config文件中的参数来调试代码,以便显示异常。

There are multiple ways for getting the error details and debugging. 获取错误详细信息和调试有多种方法。

1) Diagnostic configuration for web role. 1)Web角色的诊断配置。 Enable application error. 启用应用程序错误。 So the application error will be logged to the WADEventTable.Refer http://msdn.microsoft.com/en-us/library/azure/dn186185.aspx 因此,应用程序错误将记录到WADEventTable中。请参阅http://msdn.microsoft.com/zh-cn/library/azure/dn186185.aspx

2) While deploying/publishing the application, Enable the remote desktop for role. 2)在部署/发布应用程序时,为角色启用远程桌面。 So basically it will you can connect to role instance remotely and see in event viewer 所以基本上,您可以远程连接到角色实例并在事件查看器中查看

3) Define custom page in the application and redirect to it with exception details 3)在应用程序中定义自定义页面,并使用异常详细信息重定向到该页面

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM