Could not load file or assembly Microsoft.AspNetCore.*

293 Views Asked by At

On a service running Dotnet 7 which worked without issues, started continuously logging the following event. Service process continues to run, but nothing works on it. No requests are accepted. Process appears to be in a zombie state.

Category: Microsoft.AspNetCore.Server.Kestrel
EventId: 0
ConnectionId: 0HMUL71ECIOGR

Unhandled exception while processing 0HMUL71ECIOGR.

Exception: 
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Http.Features, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
File name: 'Microsoft.AspNetCore.Http.Features, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.HttpConnection.ProcessRequestsAsync[TContext](IHttpApplication`1 httpApplication)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.HttpConnection.ProcessRequestsAsync[TContext](IHttpApplication`1 httpApplication)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.KestrelConnection`1.ExecuteAsync()

Restarting the process recovers as if nothing happened.

What is the root cause of this?

1

There are 1 best solutions below

0
On BEST ANSWER

This is likely due to Windows Update installing an update for Dotnet, usually a security patch.

Check event log (SYSTEM) for event IDs. (These will appear around the time the issue started.)

Source: WindowsUpdateClient 
Task Category: Windows Update Agent

44  Windows Update Agent Windows Update started downloading an update.
43  Windows Update Agent Installation Started: Windows has started installing the following update: ...
19  Windows Update Agent Installation Successful: Windows successfully installed the following update: ...

If so, the installing of the update is the likely cause. Restarting the affected dotnet application should resolve the issues.

If it is not around Patch Tuesday, you may also see an update to Windows Defender Security Intelligence, Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 prior to the above events, which may have triggered installs of out-of-band security patches for other components.