serilog-sinks-file
serilog-sinks-file copied to clipboard
Detected package downgrade: System.IO from 4.3.0 to 4.1.0.
Hello,
i'm getting this error when publishing Website (Asp.net Core Version 3.1.8):
Detected package downgrade: System.IO from 4.3.0 to 4.1.0. Reference the package directly from the project to select a different version. Serilog.Sinks.File 4.1.0 -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.IO (>= 4.3.0) Serilog.Sinks.File 4.1.0 -> System.IO.FileSystem 4.0.1 -> System.IO (>= 4.1.0)
For .NET Core 3.x builds I think that should be fixed in the pre-release packages (see #139 and #172) as the references to the System packages are removed in Core 3.0 targets.
Otherwise, does adding a System.IO reference to the website avoid/fix the error?
Sorry for not updating this post, Yes i had to add the references with the correct versions for it to publish successfully as a workaround.
Was having this exact issue. Updating the file plugin to 5.0 pre-release fixed it. I didn't update the main Serilog though, not sure if that matters.
I have the same issue in my WPF project for .net5. I must add these lines to my csproj file to make it work. I also tried to use the pre-release package, but this didn't fix the problem.
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="System.Text.Encoding.Extensions" Version="4.3.0" />
<PackageReference Include="System.Runtime.Handles" Version="4.3.0" />
I believe this is fixed on the newest 5.0 dev versions. Will ship an RTM shortly.
(see also #166, #210)
We just ran into this on .net 7 using the new container publish task. No other projects are affected and all our nuget packages refernce the same version. We fixed it by including this in our packagereferences
<PackageReference Include="Microsoft.NETCore.App" Version="2.2.0" ExcludeAssets="all" PrivateAssets="all" />
https://github.com/dotnet/sdk/issues/3044#issuecomment-476795447
It might be time to nudge the minimum framework version targets for this (and Serilog) forwards. Reopening, though I don't think the change will be made here until the upstream Serilog 3.0 happens. Thanks for leaving a note 👍
@nblumhardt bumping
@bartelink guess it's time to bump dev
in serilog/serilog
to 4.0, and get started on all of this :-) ... I'll do that today :+1:
There is a way to fix this without needing to push a new package with Directory.Packages.props
to host all the packages and using Central Package Management to override the version of System.IO that is used by Serilog.