asp.net-core - 在 Windows Server 上调用 ASP .Net Core 2.1.7 微服务时出现“500 - 内部服务器错误”
问题描述
我有基于 ASP.Net Core 的微服务,它部署在运行 Windows 10 企业版的 IIS10 上。
当我尝试在 UAT 中对其进行测试时,该应用程序在所有较低环境(Dev,QA)中运行良好,它开始抛出
我验证了日志,它只说 500。在 IIS 日志中它说 500 0 0 没有别的。
我尝试启用详细日志,尝试在开发模式下运行,如下所示仍然没有打印详细信息:(我什至尝试从命令提示符运行相同的有限错误 500。
应用程序在内部调用另一个也在同一台机器上运行的服务,当我点击那个正在工作的独立设备时。这是完全相同的代码和配置在 QA 中运行良好。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Communications.Api.dll" forwardWindowsAuthToken="false" stdoutLogEnabled="true" startupTimeLimit="3600" requestTimeout="23:00:00" stdoutLogFile=".\logs\stdout">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
<handlerSettings>
<handlerSetting name="debugLevel" value="file" />
<handlerSetting name="debugFile" value="D:\Communications\logs\ancm.log" />
</handlerSettings>
</aspNetCore>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="700000000" />
</requestFiltering>
</security>
<httpErrors errorMode="Detailed" />
</system.webServer>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
</configuration>
如何获取详细信息以了解实际问题:(请指导。
解决方案
这是此问题的解决方案。
QA 和 UAT 之间存在一些配置差异。
当我将 URL 更改为 localhost 时,它就开始工作了。
推荐阅读
- spring-boot - java.net.SocketException:外部 REST 调用上的连接重置
- javascript - bootstrap 4双列表框更改项目边框颜色
- web-services - 如何使用行程数据建立像 rome2rio.com 这样的旅行计划网站?
- tableau-api - 如何使用表格中多边形的 GEOJSON 文件加入雪花表(没有坐标但存在地址)?
- node.js - AWS Lambda、NodeJS、pg-promise 库 - 高延迟 > 10000 毫秒
- racket - 在 Beginner Racket 中创建 Python 的 collections.counter() 方法
- swift - 如何在 IOS 14 swift 中显示下拉按钮菜单
- c# - AutoMapper - 试图将我的对象属性展平为字符串但出现错误
- msbuild - 如何使用 msbuild 从解决方案构建中排除项目?
- android - Android 应用程序在通过 Android Studio 安装时可以工作,但在通过 Google Play 安装和打开时会显示一些设置页面