简体   繁体   中英

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 error Package 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?

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM