部署在iis上的asp.net核心应用程序遇到500内部服务器错误 [英] asp.net core app deployed on iis meets 500 internal server error

查看:1416
本文介绍了部署在iis上的asp.net核心应用程序遇到500内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


:(糟糕。
500内部服务器错误
启动应用程序时出错。

:( Oops. 500 Internal Server Error An error occurred while starting the application.

当我向我的asp.net核心应用程序添加数据库功能并将其部署到iis时出现此消息。当我在Visual Studio中开发它时,一切进展顺利。但在部署之后,出现了此错误消息。

This message came out when I added database functionality to my asp.net core app and deployed it to iis. When I developed it in Visual Studio, everything went well. But after deploying, this error messages appeared.

我尝试使用 dotnet myapp.dll 在deploy文件夹中运行我的应用程序,发现它有效很可能这个问题与iis有关。我试图在网上添加< compilation debug =true> ..< / compilation> 。配置,但似乎没用。问题实际上是什么,或者有没有其他方法可以看到详细的错误信息,以帮助找出发生了什么?

I tried to use dotnet myapp.dll to run my app in the deploy folder, and found out it worked well. It is likely that the problem is relation to iis. I tried to add <compilation debug="true">..</compilation> to web.config, but it seems useless. What is problem are actually, or is there any other way to see the detailed error info to help find out what's happened?

推荐答案


  1. 将stdoutLogEnabled =false更改为true,然后检查stdoutLogFile =。\ logs\stdout中的日志。那里可能出现的错误TE给你点什么。

  1. Change stdoutLogEnabled="false" to true and then check the logs at stdoutLogFile=".\logs\stdout". The error(s) there might tell you something.

检查你是否使用 ASPNETCORE_ENVIRONMENT 环境变量因此使用正确的设置,如连接字符串。默认情况下,在您的计算机上有开发环境。

Check that you set up right Environment Name using ASPNETCORE_ENVIRONMENT environment variable as so use correct settings like connection string. On your machine by default you have "Development" environment.

您可以使用错误处理中间件,用于显示例外情况,例如

You may use Error Handling middlewares for showing exceptions like

app.UseDeveloperExceptionPage();


这篇关于部署在iis上的asp.net核心应用程序遇到500内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆