简体   繁体   English

在Microsoft Azure App Service中部署asp.net Webforms应用程序后出现运行时错误

[英]Runtime Error after deploy asp.net webforms app in Microsoft Azure App service

I am trying to deploy in Azure WebApp service an ASP.NET Weforms. 我正在尝试在Azure WebApp服务中部署ASP.NET Weforms。

The app runs fine locally, without any problem. 该应用程序在本地运行良好,没有任何问题。

After build ends I got the error below error in web browser after i go to myapp.azurewebsites.net i 构建结束后,我转到myapp.azurewebsites.net后,在Web浏览器中收到以下错误消息,我

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. 详细信息:要使此特定错误消息的详细信息在远程计算机上可见,请在当前Web应用程序根目录中的“ web.config”配置文件中创建一个标记。 This tag should then have its "mode" attribute set to "Off". 然后,该标签的“模式”属性应设置为“关”。

Here is source of Web.config file 这是Web.config文件的来源

<?xml version="1.0"?>
<configuration>
  <configSections/>
  <connectionStrings>
    <add name="constr" providerName="System.Data.SqlClient" connectionString="server=telendar.database.windows.net; database=TrackerDB;uid=telendar;password=*****;"/>
  </connectionStrings>
  <location path="Admin">
    <system.web>
      <customErrors mode="On"/>
      <authorization>
        <allow roles="Administrator"/>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>
  <system.web>
    <compilation debug="true" targetFramework="4.5.1"/>
    <sessionState timeout="60"/>
    <authentication mode="Forms">
      <forms defaultUrl="~/Default.aspx" loginUrl="~/AuthUser.aspx" slidingExpiration="true" timeout="60"/>
    </authentication>
    <authorization/>
    <pages controlRenderingCompatibilityVersion="4.0" validateRequest="true">
      <controls>
        <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
      </controls>
    </pages>

  </system.web>
</configuration>

You misunderstand the error message, it's telling you that your code crashed an unhandled exception and it's not allowed to show it ,it suggest you modifying the web.config to enable the details of the specific error message to be viewable on remote machines . 您误解了错误消息,它告诉您代码使未处理的异常崩溃并且不允许显示该异常,它建议您修改web.config 以使特定错误消息的详细信息在远程计算机上可见

So what you need to do is recreate the error while you browse it on the server and then solve the problem. 因此,您需要做的是在服务器上浏览错误时重新创建错误,然后解决问题。

However my suggestion is you could try to change your FrameWork maybe this will work for you. 但是我的建议是您可以尝试更改FrameWork,也许这对您有用。

If you still have other questions, please let me know. 如果您还有其他问题,请告诉我。

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

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