I believe that my .net Core app is throwing an exception. IIS refuses to show anything else than:
我相信我的.net核心应用程序抛出了一个异常。IIS拒绝显示除以下内容之外的任何内容:
HTTP Error 500.30 - ASP.NET Core app failed to start
HTTP错误500.30-ASP.NET Core应用程序无法启动
Setup:
设置:
- In IIS/Error pages/Edit Feature Settings I have chosen "Detailed errors".
- In startup.cs/Configure I have UseDeveloperExceptionPage, and also tried removing it.
Should be an obvious thing, making IIS show the errors from the app when developing.
让IIS在开发时显示应用程序中的错误应该是显而易见的。
Anyone know if there are more settings that is needed?
有人知道是否需要更多的设置吗?
更多回答
Not sure I'm totally spot on but I believe any settings you change apply to the internals of how ASP.Net functions, however the error implies ASP.Net did not start. Not sure if you have any control over this specific type of error.
不确定我是否完全正确,但我相信您更改的任何设置都适用于ASP.Net的内部功能,但错误意味着ASP.Net没有启动。不确定您是否可以控制这种特定类型的错误。
优秀答案推荐
To enable detailed error for iis asp.net core site you can follow this steps:
要启用iis-asp.net核心网站的详细错误,您可以按照以下步骤操作:
- Make sure you have set the ASPNETCORE_ENVIRONMENT environment variable to "Development" In Startup.cs:
- Enable detailed error message in iis:
Open IIS Manager, select your website
Double-click on the "Error Pages"
Click "Edit Feature Settings" on the right-hand side.
Choose "Detailed errors" and click "OK."
- Add this code in your web.config file:
<aspNetCore ... stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess">
The hostingModel attribute should be set to either "InProcess" or "OutOfProcess" depending on your hosting configuration.
hostingModel属性应设置为“InProcess”或“OutOfProcess”,具体取决于您的主机配置。
Create a folder named "logs" in the root directory of your ASP.NET Core application.
在ASP.NET Core应用程序的根目录中创建一个名为“logs”的文件夹。
assign iis_iusrs and iusr full control permission to the log folder.
为日志文件夹分配iis_iusrs和iusr完全控制权限。
Make sure you have installed .net core hosting bundle.
请确保您已经安装了.net核心托管捆绑包。
You can try running your application from the command line using the dotnet CLI to see if you can get more detail about the error or not
您可以尝试使用dotnet CLI从命令行运行应用程序,看看是否可以获得有关错误的更多详细信息
更多回答
我是一名优秀的程序员,十分优秀!