Home > Back-end >  .Net application - 500 Internal Server Error
.Net application - 500 Internal Server Error

Time:07-26

Hello guys I have a couple of questions regarding the deployment of .net application. When I tried to access the site I got a 500.19-Internal Server Error(it's shown on the image). I'm doing troubleshooting for a couple of hours without result.

  1. Do I need to run the main application in wwwroot?
  • If I run the application I can access it via provided link (localhost:5000) then the application is working with the DB smoothly.
  1. Do I need to enable port 5000 so I can be able to access the site?
  2. asp.net has wwwroot folder for the css/js/etc.. does it make conflict with server wwwroot folder?

Any help is appreciated

*The application is .net6.0

In the IIS: Default site is set on :80 with path \inetpub\wwwroot

Before Publish, this is how the application is configured: Configuration: Release Target Framework: net6.0 Deployment Mode: Self-contained Target Runtime: win-x64

Server: Windows Server 2022

web.config

<?xml version="1.0" encoding="utf-8"?>

<configuration>

  <location path="." inheritInChildApplications="false">

    <system.webServer>

      <handlers>

        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />

      </handlers>

      <aspNetCore processPath=".\ODWE.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess" />

    </system.webServer>

  </location>

    <system.webServer>

        <httpRedirect enabled="false" destination="localhost:5000" httpResponseStatus="PermRedirect" />

    </system.webServer>

</configuration>

<!--ProjectGuid: ef59-->

localhost

    <?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type='text/xsl' href='freb.xsl'?>
<!-- saved from url=(0014)about:internet -->
<failedRequest url="http://localhost:80/favicon.ico"
siteId="1"
appPoolId="DefaultAppPool"
processId="8080"
verb="GET"
remoteUserName=""
userName=""
tokenUserName="NT AUTHORITY\IUSR"
authenticationType="anonymous"
activityId="{4000001A-0001-FD00-B63F-84710C7967BB}"
failureReason="STATUS_CODE"
statusCode="500.19"
triggerStatusCode="500.19"
timeTaken="15"
xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb"
>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">;
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>1</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2022-07-22T06:46:48.360Z"/>
<Correlation ActivityID="{4000001A-0001-FD00-B63F-84710C7967BB}"/>
<Execution ProcessID="8080" ThreadID="1304"/>
<Computer>SRVSITE40</Computer>
</System>
<EventData>
<Data Name="ContextId">{4000001A-0001-FD00-B63F-84710C7967BB}</Data>
<Data Name="SiteId">1</Data>
<Data Name="AppPoolId">DefaultAppPool</Data>
<Data Name="ConnId">805306384</Data>
<Data Name="RawConnId">805306384</Data>
<Data Name="RequestURL">http://localhost:80/favicon.ico</Data>
<Data Name="RequestVerb">GET</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>GENERAL_REQUEST_START</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">;
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">;
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>5</Level>
<Opcode>4</Opcode>
<Keywords>0x100</Keywords>
<TimeCreated SystemTime="2022-07-22T06:46:48.360Z"/>
<Correlation ActivityID="{4000001A-0001-FD00-B63F-84710C7967BB}"/>
<Execution ProcessID="8080" ThreadID="1304"/>
<Computer>SRVSITE40</Computer>
</System>
<EventData>
<Data Name="ContextId">{4000001A-0001-FD00-B63F-84710C7967BB}</Data>
<Data Name="ModuleName">FailedRequestsTracingModule</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>PRE_BEGIN_REQUEST_START</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">;
<EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">;
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>5</Level>
<Opcode>5</Opcode>
<Keywords>0x100</Keywords>
<TimeCreated SystemTime="2022-07-22T06:46:48.360Z"/>
<Correlation ActivityID="{4000001A-0001-FD00-B63F-84710C7967BB}"/>
<Execution ProcessID="8080" ThreadID="1304"/>
<Computer>SRVSITE40</Computer>
</System>
<EventData>
<Data Name="ContextId">{4000001A-0001-FD00-B63F-84710C7967BB}</Data>
<Data Name="ModuleName">FailedRequestsTracingModule</Data>
<Data Name="NotificationStatus">0</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>PRE_BEGIN_REQUEST_END</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
<freb:Description Data="NotificationStatus">NOTIFICATION_CONTINUE</freb:Description>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">;
<EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">;
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>5</Level>
<Opcode>4</Opcode>
<Keywords>0x100</Keywords>
<TimeCreated SystemTime="2022-07-22T06:46:48.360Z"/>
<Correlation ActivityID="{4000001A-0001-FD00-B63F-84710C7967BB}"/>
<Execution ProcessID="8080" ThreadID="1304"/>
<Computer>SRVSITE40</Computer>
</System>
<EventData>
<Data Name="ContextId">{4000001A-0001-FD00-B63F-84710C7967BB}</Data>
<Data Name="ModuleName">RequestMonitorModule</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>PRE_BEGIN_REQUEST_START</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">;
<EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">;
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>5</Level>
<Opcode>5</Opcode>
<Keywords>0x100</Keywords>
<TimeCreated SystemTime="2022-07-22T06:46:48.360Z"/>
<Correlation ActivityID="{4000001A-0001-FD00-B63F-84710C7967BB}"/>
<Execution ProcessID="8080" ThreadID="1304"/>
<Computer>SRVSITE40</Computer>
</System>
<EventData>
<Data Name="ContextId">{4000001A-0001-FD00-B63F-84710C7967BB}</Data>
<Data Name="ModuleName">RequestMonitorModule</Data>
<Data Name="NotificationStatus">0</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>PRE_BEGIN_REQUEST_END</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
<freb:Description Data="NotificationStatus">NOTIFICATION_CONTINUE</freb:Description>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">;
<EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">;
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>5</Level>
<Opcode>4</Opcode>
<Keywords>0x100</Keywords>
<TimeCreated SystemTime="2022-07-22T06:46:48.360Z"/>
<Correlation ActivityID="{4000001A-0001-FD00-B63F-84710C7967BB}"/>
<Execution ProcessID="8080" ThreadID="1304"/>
<Computer>SRVSITE40</Computer>
</System>
<EventData>
<Data Name="ContextId">{4000001A-0001-FD00-B63F-84710C7967BB}</Data>
<Data Name="ModuleName">IsapiFilterModule</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>PRE_BEGIN_REQUEST_START</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">;
<EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">;
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>4</Level>
<Opcode>13</Opcode>
<Keywords>0x8</Keywords>
<TimeCreated SystemTime="2022-07-22T06:46:48.360Z"/>
<Correlation ActivityID="{4000001A-0001-FD00-B63F-84710C7967BB}"/>
<Execution ProcessID="8080" ThreadID="1304"/>
<Computer>SRVSITE40</Computer>
</System>
<EventData>
<Data Name="ContextId">{4000001A-0001-FD00-B63F-84710C7967BB}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>FILTER_PREPROC_HEADERS_START</Opcode>
<Keywords>
<Keyword>Filter</Keyword>
</Keywords>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">;
<EventGuid>{00237F0D-73EB-4BCF-A232-126693595847}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">;
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>1</Opcode>
<Keywords>0x8</Keywords>
<TimeCreated SystemTime="2022-07-22T06:46:48.360Z"/>
<Correlation ActivityID="{4000001A-0001-FD00-B63F-84710C7967BB}"/>
<Execution ProcessID="8080" ThreadID="1304"/>
<Computer>SRVSITE40</Computer>
</System>
<EventData>
<Data Name="ContextId">{4000001A-0001-FD00-B63F-84710C7967BB}</Data>
<Data Name="FilterName">C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_filter.dll</Data>
........
</ExtendedTracingInfo>
</Event>

CodePudding user response:

  1. Navigate to %WINDIR%\system32\inetsrv\config\
  2. Create a backup copy of the file applicationhost.config and save it to a different location.
  3. Open the applicationhost.config in Notepad.
  4. Search for the following entry and Remove or disable the XPress compression schema from the configuration using the command below:
    %windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/httpCompression /-[name='xpress']
    
  5. Verify if the compression schema has been removed form the applicationhost.config.
  6. Save the applicationhost.config and restart IIS services.
  • Related