我是 asp.net 核心应用程序的新手。
我有一个使用存储库模式的 asp.net 核心应用程序。它有一个名为ApplicationsAPIController的 api 控制器。
ApplicationsAPIController有一个返回所有应用程序的GetApplications方法。
我已将应用程序发布到远程服务器。从邮递员调用 GetApplications api 时抛出500 Internal Server Error并带有以下 HTML 作为响应:
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request. </h2>
<h3>Development Mode</h3>
<p>
Swapping to
<strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the
<strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to
<strong>Development</strong>, and restarting the application.
</p>
注意:以上 api 在开发环境(本地)中完美运行。
根据错误,我想我必须设置一个登台或生产环境。但我找不到任何好的和一步一步的文件来设置。我已经尝试了很多方法,但都失败了。