简体   繁体   中英

Why I get 500 internal server error in asp.net core hosted in IIS?

I published my .Net core web to IIS in localhost. In my code I use HttpClient.GetAsync to retrieve information from external resource. The HttpClientHandler is configured with ' UseDefaultCredentials = true '. Everything is working fine when running under IISEXPRESS. In IIS I get 500 'internal server error' on response from HttpClient.GetAsync

Installed the host bundle and tried many things but nothing worked.

Help please!

Thanks for Alex and RedgoodBreaker's suggestions. Their suggestions are correct, and the problem can be located quickly.

1. Windows Event Viewer

Open Event Viewer -> Windows Logs -> Application

2. Log creation and redirection

Enhanced diagnostic logs

3. Enable Failed Request Tracing Settings

Offical doc: Using Failed Request Tracing Rules to Troubleshoot Application Request Routing

在此处输入图片说明

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM