Exception Unhandled : Could not load file or assembly 'Serilog.Extensions.Hosting,

226 Views Asked by At

When I run my application, this exception is thrown even before the start of debugging. enter image description here

System.IO.FileNotFoundException: 'Could not load file or assembly 'Serilog.Extensions.Hosting, Version=7.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10'. Le fichier spécifié est introuvable.'

This is my .csproj references :

<PackageReference Include="Serilog" Version="3.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0.0" />
<PackageReference Include="StackExchange.Redis" Version="2.6.122" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />

enter image description here

I tried to clean and build the entire solution and projects so many times also dotnet restore.

1

There are 1 best solutions below

0
El Ronnoco On

Try

  • Closing visual studio
  • Deleting all bin and obj folders
  • Reopen VS, restore nugets
  • Clean and rebuild

Otherwise it may be that you need to install another netcore runtime.