.net core 部署错误An error occurred while starting the application

Internal Server Error

An error occurred while starting the application.

.NET Core 4.6.28207.03 X64 v4.0.0.0    |   Microsoft.AspNetCore.Hosting version 2.2.7-servicing-10089    |    Microsoft Windows 10.0.14393    |   Need help?
解决办法:打开web.config日志
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Yxx.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: cbd5977e-39e1-4a3f-9a0e-c9cd7dc87302-->
将红字内容设置为true,运行网站在目录下生成日志文件夹logs,查看相关日志:

主要原因是启动时因ueditor上传目录不存在导致,或者直接新建个目录,或者通过改写代码将upload移动到wwwroot下,两者均可解决问题