I have created new project web.net core without doing any changes and use the created default files. I can successfully run this using the debug mode, but if I am going to publish it on IIS it will give me error: HTTP Error 500.19 - Internal Server Error and here is the error details:
The requested page cannot be accessed because the related configuration data for the page is invalid.
I already tried to modify the web.config to point the processPath to my dotnet location but it still have the same error result:
<?xml version="1.0" encoding="utf-8"?> <configuration> <location path="." inheritInChildApplications="false"> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\WebApplication1.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /> </system.webServer> </location> </configuration> <!--ProjectGuid: d4e1dda9-f8ba-4752-883d-43c86faa3c60-->
I am not yet sure if this one is related to my IIS setup configuration. Any suggestion/comments if encountered this. TIA
check that under which application pool identity your site is running. to check you could follow the below steps:
1)open iis manager.
2)select application pools and select your application pool name from the middle pane.
3)select the advance setting from the action pane.
then assign permission to the site folder. 1)open iis manager, select your site.
2)right-click on-site and select Edit permission.
3)In properties, windows select the security tab-> edit.
4)one pop up window will open in that select add.
5)in select user or group windows type "iusr" in object name text box and click ok and assign full permission.
6)Repeat the above steps and add "iis_iusrs" and "IIS AppPool\" user permission.
7)After doing changes restart the iis server.
You need to install the “ASP.NET Core/.NET Core: Runtime & Hosting Bundle” on to the server.
you could also set load user profile to true in iis application pool advance setting.
please refer this below link for more detail:
ASP.Net Core Publish: HTTP Error 500.19 - Internal Server Error
500.19 error or 502.5 error when hosting asp.net core 2 application inside IIS
User contributions licensed under CC BY-SA 3.0