I added URL rewrite section in web.config file in .Net Core 2.2 Application, and it starts generating the error HTTP Error 500.19 - Internal Server Error
.
Error Details:
Server Error in Application "application name" HTTP Error 500.19 – Internal Server Error HRESULT: 0x8007000d Description of HRESULT The requested page cannot be accessed because the related configuration data for the page is invalid.
Cause
As per MSDN:
This problem occurs because the ApplicationHost.config or Web.config file contains a malformed XML element.
Resolution
As per MSDN:
Delete the malformed XML element from the ApplicationHost.config or Web.config file.
But since URL rewrite config section is not malformed as these are all valid config xml. In my case I found that URL rewrite module was not installed on the server, so installing the missing module fixed my issue.
You can download
URL Rewrite Extension
from Official Microsoft IIS Site:
Or use
Direct MSI link for winx64
It should start working at this point.
Install .Net Core Hosting Bundle and reset IIS:
If it still not works, try to install / repair the .Net Core Hosting Bundle
. e.g You can download version 6.0 from
Download .NET 6.0
Finally, reset IIS by running the following command:
iisreset
You need to open the command prompt with Run as administrator
option.
No comments:
Post a Comment