Make sure the following modules are registered in IIS modules: AspNetCoreModule & AspNetCoreModuleV2
you can install them by running the following commands:
open cmd as admin
navigate to inetSrv location C:\Windows\System32\inetsrv run: appcmd.exe
install module /name:AspNetCoreModule /image:%windir%\system32\inetsrv\aspnetcore.dll
install module /name:AspNetCoreModuleV2 /image:"%ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll"