Search code examples
c#serilog.net-6.0

Serilog not installing in Library project .Net 6


I have a Library project in .net6, I have attempted to install serilog version 2.10 or serilog.AspCore version 5.0 a couple of time but both returned error. I keep getting errorPackage Serilog.Sinks.Debug 2.0.0 is not compatible with net6.0 each time. Below is the .csproj file.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.3" />
  </ItemGroup>
</Project>

Does this mean serilog is not available for .net6 library project or I am not getting the version right?


Solution

  • I have tried the following project setup and works fine for me:

    <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
            <TargetFramework>net6.0</TargetFramework>
            <Nullable>enable</Nullable>
        </PropertyGroup>
        <ItemGroup>
            <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.3" />
            <PackageReference Include="Serilog" Version="2.10.0" />
            <PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
        </ItemGroup>
    </Project>