HTTP 500.19 Error for Dot Net 5.0 WebAPI Application, iis, windows

I have a WebAPI install on a server of mine and I keep getting the following error when browsing it:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

I set this up using Dot Net 5.0 WebAPI and I have it installed in the latest version of IIS after publishing to a directory.

Here’s what my web.config looks like:

<?xml version="1.0" encoding="utf-8"?>
  <location path="." inheritInChildApplications="false">
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      <aspNetCore processPath="dotnet" arguments=".akmazio-api.dll" stdoutLogEnabled="false" stdoutLogFile=".logsstdout" hostingModel="inprocess" />
<!--ProjectGuid: 3b944703-a011-4408-9581-8c919ba4ed0e-->

Any thoughts on what might be causing this issue and how to resolve it?

Source: Windows Questions