当Thread.CurrentPricipal为null时,如何获取运行Web应用程序的身份(ApplicationPool身份)?

时间:2019-01-22 12:51:32

标签: asp.net-core iis-8 windows-server

我已经将asp.net core 2.2 Web应用程序部署为IIS的WebSite。我已将应用程序池标识设置为ApplicationPoolIdentity:

[IIS Screenshol[1]

以下行引发NullReferenceException:

System.Threading.Thread.CurrentPrincipal.Identity.Name

我应该如何获取运行过程的用户名?

0 个答案:

没有答案
相关问题