Open Aldaviva opened 4 months ago
I think the steps to reproduce this issue are
Aside from getting notified that a new version of .NET was installed somehow, I'm not sure how to avoid this problem automatically.
Maybe you could start a file watcher for C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.6\hostpolicy.dll
or whatever your process has loaded, and when it is deleted, take some action like restart the process with the same arguments, or call some other process like systemctl restart myservice.service
or Restart-Service MyService
.
I'm going to attempt to solve this with Aldaviva/RuntimeUpgradeNotifier.
This happened 3 hours after the computer shut down unexpectedly due to a power outage, and I turned it back on when power was restored.
The getter for
EventLogRecord.Id
threw the exception when called fromEventLogStandbyListener.onEventRecord(object?, EventRecordWrittenEventArgs)
.Running the program again manually later started fine.
The file
C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.6\System.Security.Principal.Windows.dll
exists on my computer and its Authenticode signature is valid. Maybe .NET 8.0.6 was in the middle of installing the very recent 8.0.6 update when my program launched during boot? This installation seems to have finished at 11:52 PM, before the crash. Maybe the lazy-loaded DLL file got pulled out from under my running process, and it crashed later when it tried to access it with the old runtime paths still in memory but the corresponding files gone from disk.