Hi,
I have a recurrent and seemingly quite random runtime issue on local servers of my customers (>= Windows 10 || >= Windows Server 16) while running an ASP.NET Core server application (Kestrel) : they sometime encounter a "FileNotFound" exception on some of the libraries required by the application code.
Some general context information:
- the executable is a server operating mainly on the local network of my customers
- it is published as single-file and self-deployed (see project .csproj further)
I recently developped a workaround that consists in detecting some of these "FileNotFound" exceptions as a trigger to reboot the application, which temporarily solves the problem… unless the "System.Diagnostics.Process" library is not found itself while I try to use it to stop my running instance after launching a new one (Process.Start // Process.GetCurrentProcess().Kill()).
I ran into some quite similar reports, but they differ from my case on an essential point : they do not happen randomly at runtime.
See :
Technical description
Several major libraries could not get loaded at runtime, including the one required for the self-rebooting utility :
- System.Diagnostics.Process (log timestamp :
2022-01-20 04:33:55.9801)
- Grpc.Core (timestamp:
2022-01-20 04:12:17.3012)
- EntityFrameworkCore (timestamp:
2022-01-20 04:33:55.9641)
Target framework : netcoreapp3.1
Please remind that manually relaunching the application solves the issue (but as it is deployed at our many customers, this is not a quite suitable solution to us).
Log trace
Fichier log configuré.2022-01-20 03:57:13.6797|INFO|iZiServer|Logger instantiated.
2022-01-20 03:57:13.7033|INFO|iZiServer|iZiServer (version : "1.1.0.11") launches "Program"
2022-01-20 03:57:13.8460|INFO|iZiServer|Launching broadcasting service.
2022-01-20 03:57:13.8460|INFO|iZiServer|Broadcast message : iZiServer@50050,50052
2022-01-20 03:57:13.8460|INFO|iZiServer|iZiServer now ready to broadcast its address on UDP socket, port 8888
2022-01-20 03:57:13.8460|INFO|iZiServer|MonitorTracabilitePictures() launches tracabilite files verification.
2022-01-20 03:57:13.8460|INFO|iZiServer|Checking for new tracabilite files info.
2022-01-20 03:57:17.2692|INFO|iZiServer|MonitorTracabilitePictures() exported new info.
2022-01-20 03:57:17.2692|INFO|iZiServer|Launching iZiServer gRPC activity monitoring service.
2022-01-20 04:12:17.3012|ERROR|iZiServer|System.IO.FileNotFoundException:
File name: 'Grpc.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad'
at iZiServer.AutoMonitor.GrpcMonitorClient.GrpcClientTool.IsGrpcChannelUp(ILogger logger)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at iZiServer.AutoMonitor.GrpcMonitorClient.GrpcClientTool.IsGrpcChannelUp(ILogger logger)
at iZiServer.AutoMonitor.GrpcMonitorService.VerifyGrpcChannel(CancellationToken stoppingToken)
at iZiServer.AutoMonitor.GrpcMonitorService.ExecuteAsync(CancellationToken stoppingToken)
System.IO.FileNotFoundException:
File name: 'Grpc.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad'
at iZiServer.AutoMonitor.GrpcMonitorClient.GrpcClientTool.IsGrpcChannelUp(ILogger logger)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at iZiServer.AutoMonitor.GrpcMonitorClient.GrpcClientTool.IsGrpcChannelUp(ILogger logger)
at iZiServer.AutoMonitor.GrpcMonitorService.VerifyGrpcChannel(CancellationToken stoppingToken)
at iZiServer.AutoMonitor.GrpcMonitorService.ExecuteAsync(CancellationToken stoppingToken)
2022-01-20 04:27:17.2692|INFO|iZiServer|MonitorTracabilitePictures() launches tracabilite files verification.
2022-01-20 04:27:17.2692|INFO|iZiServer|Checking for new tracabilite files info.
2022-01-20 04:27:17.2692|INFO|iZiServer|MonitorTracabilitePictures() exported nothing.
2022-01-20 04:33:25.9219|INFO|iZiServer|Client discovered : 192.168.1.12
2022-01-20 04:33:35.9536|INFO|iZiServer|Client discovered : 192.168.1.12
2022-01-20 04:33:45.9354|INFO|iZiServer|Vérification annulée: un ping UDP plus récent a été reçu.
2022-01-20 04:33:45.9354|INFO|iZiServer|Dernier ping UDP : 20/01/22 04:33:35.9544
2022-01-20 04:33:55.9641|INFO|iZiServer|Dernier ping UDP : 20/01/22 04:33:35.9544
2022-01-20 04:33:55.9641|INFO|iZiServer|Dernier appel gRPC : 01/01/70 00:00:00.0000
2022-01-20 04:33:55.9641|INFO|iZiServer|Redémarrage automatique d’iZiServer (indisponibilité du socket gRPC détectée).
2022-01-20 04:33:55.9641|ERROR|iZiServer|System.IO.FileNotFoundException:
File name: 'Microsoft.EntityFrameworkCore, Version=5.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at iZiServer.Persistence.Database.MonitoringsRepository.AddEvent(String eventName, DateTime timestamp)
at iZiServer.Persistence.Logger.Monitor(String eventName, DateTime timestamp)
System.IO.FileNotFoundException:
File name: 'Microsoft.EntityFrameworkCore, Version=5.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at iZiServer.Persistence.Database.MonitoringsRepository.AddEvent(String eventName, DateTime timestamp)
at iZiServer.Persistence.Logger.Monitor(String eventName, DateTime timestamp)
2022-01-20 04:33:55.9641|WARN|iZiServer|Monitoring iZiServer : échec de l’enregistrement d’un évènement dans la table de monitoring.
2022-01-20 04:33:55.9801|ERROR|iZiServer|System.IO.FileNotFoundException:
File name: 'System.Diagnostics.Process, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at iZiServer.AutoMonitor.GrpcMonitorService.RebootiZiServer()
at iZiServer.AutoMonitor.LastCallsRegistry.DelayedGrpcCallChecking(ILogger logger)
at iZiServer.Core.TaskUtilities.FireAndForgetSafeAsync(Task task, IErrorHandler handler)
System.IO.FileNotFoundException:
File name: 'System.Diagnostics.Process, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at iZiServer.AutoMonitor.GrpcMonitorService.RebootiZiServer()
at iZiServer.AutoMonitor.LastCallsRegistry.DelayedGrpcCallChecking(ILogger logger)
at iZiServer.Core.TaskUtilities.FireAndForgetSafeAsync(Task task, IErrorHandler handler)
2022-01-20 04:56:41.8556|INFO|iZiServer|Client discovered : 192.168.1.10
2022-01-20 04:56:51.8600|INFO|iZiServer|Client discovered : 192.168.1.10
2022-01-20 04:57:01.8646|INFO|iZiServer|Vérification annulée: une procédure de redémarrage vient d’être lancée.
2022-01-20 04:57:11.8640|INFO|iZiServer|Vérification annulée: une procédure de redémarrage vient d’être lancée.
Code excerpts
Reboot utility (for System.Diagnostics.Process)
using iZiServer.AutoMonitor.GrpcMonitorClient;
using iZiServer.Core;
using iZiServer.Persistence;
using iZiServer.Persistence.Configuration;
using Microsoft.Extensions.Hosting;
using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace iZiServer.AutoMonitor
{
public class GrpcMonitorService : BackgroundService
{
private ILogger logger;
private static bool onGoingReboot = false;
internal static void RebootiZiServer()
{
var logger = new Logger();
logger.Info("Auto-reboot of iZiServer…");
if (onGoingReboot)
{
logger.Info("Annulation auto-reboot : un redémarrage est déjà en cours.");
return;
}
var progPath = ConfigurationAccessor.RetrieveConfiguration().ExecutableBinariesFolder;
if (!string.IsNullOrWhiteSpace(progPath))
{
var iziserverPath = Path.Combine(progPath, "iZiServer.exe");
logger?.Info("Starting new iZiServer instance…");
Process.Start(iziserverPath);
onGoingReboot = true;
logger?.Info("Shutting down old iZiServer instance…");
Process.GetCurrentProcess().Kill();
}
}
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
try
{
logger = new Logger();
logger?.Info("Launching iZiServer gRPC activity monitoring service.");
var interval = TimeSpan.FromMinutes(15);
while (!stoppingToken.IsCancellationRequested)
{
await Task.Delay(interval, stoppingToken);
await VerifyGrpcChannel(stoppingToken);
}
}
catch (OperationCanceledException ex)
{
logger?.Info(ex.Message);
}
catch (Exception ex)
{
logger?.Error(ex);
throw;
}
}
private async Task VerifyGrpcChannel(CancellationToken stoppingToken)
{
var isChannelUp = await GrpcClientTool.IsGrpcChannelUp(logger);
logger?.Info($"iZiServer gPRC channels availability : {(isChannelUp ? "OK" : "KO")}");
if (!stoppingToken.IsCancellationRequested && !isChannelUp)
{
RebootiZiServer();
}
}
}
}
Log utility (for EntityFrameworkCore)
using iZiServer.Core;
using iZiServer.Core.Monitoring;
using iZiServer.Persistence.Database;
using System;
namespace iZiServer.Persistence
{
public class Logger : NugetLogger.Logger, ILogger
{
private readonly IMonitoringRepository monitoringRepository = new MonitoringsRepository();
public void Monitor(string eventName, DateTime timestamp)
{
try
{
monitoringRepository.AddEvent(eventName, timestamp);
}
catch (Exception ex)
{
Error(ex);
Warn("Monitoring iZiServer : échec de l’enregistrement d’un évènement dans la table de monitoring.");
}
}
}
}
Project files
Base application .csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<OutputType>Exe</OutputType>
<PublishSingleFile>true</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
<IncludeContentFilesProjectOutputGroup>true</IncludeContentFilesProjectOutputGroup>
<IncludeSymbolsInSingleFile>true</IncludeSymbolsInSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Version>1.1.0.11</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="BackgroundServices\**" />
<Content Remove="BackgroundServices\**" />
<EmbeddedResource Remove="BackgroundServices\**" />
<None Remove="BackgroundServices\**" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\iZiServer.AutoMonitor\iZiServer.AutoMonitor.csproj" />
<ProjectReference Include="..\iziServer.Core\iZiServer.Core.csproj" />
<ProjectReference Include="..\iZiServer.Globals\iZiServer.Globals.csproj" />
<ProjectReference Include="..\iziServer.Persistence\iZiServer.Persistence.csproj" />
<ProjectReference Include="..\iziServer.WebServices\iZiServer.WebServices.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Certificates\server.pfx" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="Grpc.AspNetCore" Version="2.35.0" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="Protos\BooleanResponse.proto" GrpcServices="None" />
[...]
</ItemGroup>
</Project>
Reboot component .csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Remove="Protos\BooleanResponse.proto" />
<None Remove="Protos\CheckChannelService.proto" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.14.0" />
<PackageReference Include="Grpc.Core" Version="2.35.0" />
<PackageReference Include="Grpc.Core.Api" Version="2.35.0" />
<PackageReference Include="Grpc.Tools" Version="2.35.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\iZiServer.Globals\iZiServer.Globals.csproj" />
<ProjectReference Include="..\iziServer.Persistence\iZiServer.Persistence.csproj" />
</ItemGroup>
<ItemGroup>
<Protobuf Include="Protos\BooleanResponse.proto" GrpcServices="None" />
<Protobuf Include="Protos\CheckChannelService.proto" GrpcServices="Client" />
</ItemGroup>
</Project>
Persistence component .csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ini-parser" Version="2.5.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NugetLogger" Version="3.0.1" />
<PackageReference Include="Sentry" Version="3.0.6" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
<PackageReference Include="System.IO.Abstractions" Version="13.2.10" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\iziServer.Core\iZiServer.Core.csproj" />
</ItemGroup>
</Project>
Reboot component dependencies manifest
{
"runtimeTarget": {
"name": ".NETStandard,Version=v2.1/",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETStandard,Version=v2.1": {},
".NETStandard,Version=v2.1/": {
"iZiServer.AutoMonitor/1.0.0": {
"dependencies": {
"Google.Protobuf": "3.14.0",
"Grpc.Core": "2.35.0",
"Grpc.Core.Api": "2.35.0",
"Grpc.Tools": "2.35.0",
"Microsoft.Extensions.Hosting.Abstractions": "5.0.0",
"iZiServer.Globals": "1.0.0",
"iZiServer.Persistence": "1.0.0"
},
"runtime": {
"iZiServer.AutoMonitor.dll": {}
}
},
(…)
"Grpc.Core/2.35.0": {
"dependencies": {
"Grpc.Core.Api": "2.35.0",
"System.Memory": "4.5.4"
},
"runtime": {
"lib/netstandard2.0/Grpc.Core.dll": {
"assemblyVersion": "2.0.0.0",
"fileVersion": "2.35.0.0"
}
}
},
"Grpc.Core.Api/2.35.0": {
"dependencies": {
"System.Memory": "4.5.4"
},
"runtime": {
"lib/netstandard2.0/Grpc.Core.Api.dll": {
"assemblyVersion": "2.0.0.0",
"fileVersion": "2.35.0.0"
}
}
},
"Grpc.Tools/2.35.0": {},
"ini-parser/2.5.2": {
"runtime": {
"lib/net20/INIFileParser.dll": {
"assemblyVersion": "2.5.2.0",
"fileVersion": "2.5.2.0"
}
}
},
(…)
"Microsoft.EntityFrameworkCore.Abstractions/5.0.3": {
"runtime": {
"lib/netstandard2.1/Microsoft.EntityFrameworkCore.Abstractions.dll": {
"assemblyVersion": "5.0.3.0",
"fileVersion": "5.0.321.6417"
}
}
},
"Microsoft.EntityFrameworkCore.Analyzers/5.0.3": {},
"Microsoft.EntityFrameworkCore.Relational/5.0.3": {
"dependencies": {
"Microsoft.EntityFrameworkCore": "5.0.3",
"Microsoft.Extensions.Configuration.Abstractions": "5.0.0"
},
"runtime": {
"lib/netstandard2.1/Microsoft.EntityFrameworkCore.Relational.dll": {
"assemblyVersion": "5.0.3.0",
"fileVersion": "5.0.321.6417"
}
}
},
"Microsoft.EntityFrameworkCore.SqlServer/5.0.3": {
"dependencies": {
"Microsoft.Data.SqlClient": "2.0.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.3"
},
"runtime": {
"lib/netstandard2.1/Microsoft.EntityFrameworkCore.SqlServer.dll": {
"assemblyVersion": "5.0.3.0",
"fileVersion": "5.0.321.6417"
}
}
},
(…)
"System.Diagnostics.Process/4.3.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.1",
"Microsoft.Win32.Primitives": "4.3.0",
"Microsoft.Win32.Registry": "4.7.0",
"System.Collections": "4.3.0",
"System.Diagnostics.Debug": "4.3.0",
"System.Globalization": "4.3.0",
"System.IO": "4.3.0",
"System.IO.FileSystem": "4.3.0",
"System.IO.FileSystem.Primitives": "4.3.0",
"System.Resources.ResourceManager": "4.3.0",
"System.Runtime": "4.3.0",
"System.Runtime.Extensions": "4.3.0",
"System.Runtime.Handles": "4.3.0",
"System.Runtime.InteropServices": "4.3.0",
"System.Text.Encoding": "4.3.0",
"System.Text.Encoding.Extensions": "4.3.0",
"System.Threading": "4.3.0",
"System.Threading.Tasks": "4.3.0",
"System.Threading.Thread": "4.3.0",
"System.Threading.ThreadPool": "4.3.0",
"runtime.native.System": "4.3.0"
}
},
(…)
"libraries": {
(…)
"Grpc.Core/2.35.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-nEh7OqeJOuLl9PnJ1tpdVoginCcYd5jjKERr3fjLgcmvc7OKqObMgoSpH0I5o4vy8RP4t2Lu10FGtlnIDhCkTw==",
"path": "grpc.core/2.35.0",
"hashPath": "grpc.core.2.35.0.nupkg.sha512"
},
"Grpc.Core.Api/2.35.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-3ZpDzd5iMRBUv22hcvBqhL1yFFNfa9AccG8koco0ezbO/NMt3E0GsTf1BeIZ2G6ceFZR3fEMawpiJAlXhDEpQA==",
"path": "grpc.core.api/2.35.0",
"hashPath": "grpc.core.api.2.35.0.nupkg.sha512"
},
"Grpc.Tools/2.35.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-mVXSeJaBHfvGz74HxXwPys4BlRQlmKy4JQFMj5IewrkSLJwyw/Pnp76C/y9SomlkG8nxJDf3oNXgamM8Ua1f4g==",
"path": "grpc.tools/2.35.0",
"hashPath": "grpc.tools.2.35.0.nupkg.sha512"
},
"ini-parser/2.5.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-hp3gKmC/14+6eKLgv7Jd1Z7OV86lO+tNfOXr/stQbwmRhdQuXVSvrRAuAe7G5+lwhkov0XkqZ8/bn1PYWMx6eg==",
"path": "ini-parser/2.5.2",
"hashPath": "ini-parser.2.5.2.nupkg.sha512"
},
(…)
"Microsoft.EntityFrameworkCore/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Dd0z2X2/YVlVWNjNyeNR3+av8wsNe+yYV16xDHJoD/u6eHypPd8g31eNOPqUTDKLPkqqkV7MtzhkXo/OQYFFhA==",
"path": "microsoft.entityframeworkcore/5.0.3",
"hashPath": "microsoft.entityframeworkcore.5.0.3.nupkg.sha512"
},
"Microsoft.EntityFrameworkCore.Abstractions/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-5XYcMQC8FZvYIEcMoq3gIkpWHHmfLyymZ4IjBqkNcR3Eqa5uE8Bbtv63lOAK5Nvh6fRovqRsOzvAx8kNB/3aVg==",
"path": "microsoft.entityframeworkcore.abstractions/5.0.3",
"hashPath": "microsoft.entityframeworkcore.abstractions.5.0.3.nupkg.sha512"
},
"Microsoft.EntityFrameworkCore.Analyzers/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-4sR0ggbrdAZS7f8T5AwHxHa+/b0QyVeMAaplCWihNQJNSgA1mF+bBzdxiL5KpWAN0EZflXuFiQy0BV6FupxITQ==",
"path": "microsoft.entityframeworkcore.analyzers/5.0.3",
"hashPath": "microsoft.entityframeworkcore.analyzers.5.0.3.nupkg.sha512"
},
"Microsoft.EntityFrameworkCore.Relational/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-fiWf3OWsm5/8z+J3DiSMyNz2OkBjr6IvoJ/DzC6XgArDu17sHvTG3mdUC07cEUIo4n5XV5gthgdLalt/ALD6bw==",
"path": "microsoft.entityframeworkcore.relational/5.0.3",
"hashPath": "microsoft.entityframeworkcore.relational.5.0.3.nupkg.sha512"
},
"Microsoft.EntityFrameworkCore.SqlServer/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-T0cU7999ffojbqEVF7nTp7IoSHrzo748BQRMSmmlmKC+uluQbV18GhtLLu3aOA5Egmja8gFEuN9+QZdViA0Dfw==",
"path": "microsoft.entityframeworkcore.sqlserver/5.0.3",
"hashPath": "microsoft.entityframeworkcore.sqlserver.5.0.3.nupkg.sha512"
},
(…)
"System.Diagnostics.Process/4.3.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==",
"path": "system.diagnostics.process/4.3.0",
"hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512"
},
(…)
}
Persistence component dependencies manifest
{
"runtimeTarget": {
"name": ".NETStandard,Version=v2.1/",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETStandard,Version=v2.1": {},
".NETStandard,Version=v2.1/": {
"iZiServer.Persistence/1.0.0": {
"dependencies": {
"Microsoft.EntityFrameworkCore": "5.0.3",
"Microsoft.EntityFrameworkCore.SqlServer": "5.0.3",
"Newtonsoft.Json": "12.0.3",
"NugetLogger": "3.0.1",
"Sentry": "3.0.6",
"System.Data.SqlClient": "4.8.2",
"System.IO.Abstractions": "13.2.10",
"System.Text.Encoding.CodePages": "5.0.0",
"iZiServer.Core": "1.0.0",
"ini-parser": "2.5.2"
},
"runtime": {
"iZiServer.Persistence.dll": {}
}
},
(…)
"Microsoft.EntityFrameworkCore/5.0.3": {
"dependencies": {
"Microsoft.EntityFrameworkCore.Abstractions": "5.0.3",
"Microsoft.EntityFrameworkCore.Analyzers": "5.0.3",
"Microsoft.Extensions.Caching.Memory": "5.0.0",
"Microsoft.Extensions.DependencyInjection": "5.0.1",
"Microsoft.Extensions.Logging": "5.0.0",
"System.Collections.Immutable": "5.0.0",
"System.ComponentModel.Annotations": "5.0.0",
"System.Diagnostics.DiagnosticSource": "5.0.1"
},
"runtime": {
"lib/netstandard2.1/Microsoft.EntityFrameworkCore.dll": {
"assemblyVersion": "5.0.3.0",
"fileVersion": "5.0.321.6417"
}
}
},
"Microsoft.EntityFrameworkCore.Abstractions/5.0.3": {
"runtime": {
"lib/netstandard2.1/Microsoft.EntityFrameworkCore.Abstractions.dll": {
"assemblyVersion": "5.0.3.0",
"fileVersion": "5.0.321.6417"
}
}
},
"Microsoft.EntityFrameworkCore.Analyzers/5.0.3": {},
"Microsoft.EntityFrameworkCore.Relational/5.0.3": {
"dependencies": {
"Microsoft.EntityFrameworkCore": "5.0.3",
"Microsoft.Extensions.Configuration.Abstractions": "5.0.0"
},
"runtime": {
"lib/netstandard2.1/Microsoft.EntityFrameworkCore.Relational.dll": {
"assemblyVersion": "5.0.3.0",
"fileVersion": "5.0.321.6417"
}
}
},
"Microsoft.EntityFrameworkCore.SqlServer/5.0.3": {
"dependencies": {
"Microsoft.Data.SqlClient": "2.0.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.3"
},
"runtime": {
"lib/netstandard2.1/Microsoft.EntityFrameworkCore.SqlServer.dll": {
"assemblyVersion": "5.0.3.0",
"fileVersion": "5.0.321.6417"
}
}
},
(…)
"libraries": {
"iZiServer.Persistence/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
(…)
"Microsoft.EntityFrameworkCore/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Dd0z2X2/YVlVWNjNyeNR3+av8wsNe+yYV16xDHJoD/u6eHypPd8g31eNOPqUTDKLPkqqkV7MtzhkXo/OQYFFhA==",
"path": "microsoft.entityframeworkcore/5.0.3",
"hashPath": "microsoft.entityframeworkcore.5.0.3.nupkg.sha512"
},
"Microsoft.EntityFrameworkCore.Abstractions/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-5XYcMQC8FZvYIEcMoq3gIkpWHHmfLyymZ4IjBqkNcR3Eqa5uE8Bbtv63lOAK5Nvh6fRovqRsOzvAx8kNB/3aVg==",
"path": "microsoft.entityframeworkcore.abstractions/5.0.3",
"hashPath": "microsoft.entityframeworkcore.abstractions.5.0.3.nupkg.sha512"
},
"Microsoft.EntityFrameworkCore.Analyzers/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-4sR0ggbrdAZS7f8T5AwHxHa+/b0QyVeMAaplCWihNQJNSgA1mF+bBzdxiL5KpWAN0EZflXuFiQy0BV6FupxITQ==",
"path": "microsoft.entityframeworkcore.analyzers/5.0.3",
"hashPath": "microsoft.entityframeworkcore.analyzers.5.0.3.nupkg.sha512"
},
"Microsoft.EntityFrameworkCore.Relational/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-fiWf3OWsm5/8z+J3DiSMyNz2OkBjr6IvoJ/DzC6XgArDu17sHvTG3mdUC07cEUIo4n5XV5gthgdLalt/ALD6bw==",
"path": "microsoft.entityframeworkcore.relational/5.0.3",
"hashPath": "microsoft.entityframeworkcore.relational.5.0.3.nupkg.sha512"
},
"Microsoft.EntityFrameworkCore.SqlServer/5.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-T0cU7999ffojbqEVF7nTp7IoSHrzo748BQRMSmmlmKC+uluQbV18GhtLLu3aOA5Egmja8gFEuN9+QZdViA0Dfw==",
"path": "microsoft.entityframeworkcore.sqlserver/5.0.3",
"hashPath": "microsoft.entityframeworkcore.sqlserver.5.0.3.nupkg.sha512"
},
(…)
}
Hi,
I have a recurrent and seemingly quite random runtime issue on local servers of my customers (>= Windows 10 || >= Windows Server 16) while running an ASP.NET Core server application (Kestrel) : they sometime encounter a "FileNotFound" exception on some of the libraries required by the application code.
Some general context information:
I recently developped a workaround that consists in detecting some of these "FileNotFound" exceptions as a trigger to reboot the application, which temporarily solves the problem… unless the "System.Diagnostics.Process" library is not found itself while I try to use it to stop my running instance after launching a new one (Process.Start // Process.GetCurrentProcess().Kill()).
I ran into some quite similar reports, but they differ from my case on an essential point : they do not happen randomly at runtime.
See :
System.IO.FileNotFoundException: Could not load file or assembly 'mscorlib, Version=4.0.0.0#34494Technical description
Several major libraries could not get loaded at runtime, including the one required for the self-rebooting utility :
2022-01-20 04:33:55.9801)2022-01-20 04:12:17.3012)2022-01-20 04:33:55.9641)Target framework : netcoreapp3.1
Please remind that manually relaunching the application solves the issue (but as it is deployed at our many customers, this is not a quite suitable solution to us).
Log trace
Code excerpts
Reboot utility (for System.Diagnostics.Process)
Log utility (for EntityFrameworkCore)
Project files
Base application .csproj
Reboot component .csproj
Persistence component .csproj
Reboot component dependencies manifest
Persistence component dependencies manifest