Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detected package downgrade: System.IO from 4.3.0 to 4.1.0. #177

Closed
Yaz-X opened this issue Sep 14, 2020 · 12 comments
Closed

Detected package downgrade: System.IO from 4.3.0 to 4.1.0. #177

Yaz-X opened this issue Sep 14, 2020 · 12 comments

Comments

@Yaz-X
Copy link

Yaz-X commented Sep 14, 2020

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)

@Numpsy
Copy link
Member

Numpsy commented Oct 6, 2020

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?

@Yaz-X
Copy link
Author

Yaz-X commented Oct 6, 2020

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.

@Mgamerz
Copy link

Mgamerz commented Nov 3, 2020

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.

@JochnGst
Copy link

JochnGst commented May 4, 2021

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" />

@nblumhardt
Copy link
Member

I believe this is fixed on the newest 5.0 dev versions. Will ship an RTM shortly.

@nblumhardt
Copy link
Member

(see also #166, #210)

@Joren-Thijs-KasparSolutions
Copy link

Joren-Thijs-KasparSolutions commented Dec 20, 2022

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" />

dotnet/sdk#3044 (comment)

@nblumhardt
Copy link
Member

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 👍

@bartelink
Copy link
Member

@nblumhardt bumping

@nblumhardt
Copy link
Member

@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 👍

@AraHaan
Copy link

AraHaan commented Feb 22, 2024

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.

@nblumhardt
Copy link
Member

Serilog 4.x should no longer suffer from this issue, closing again - and thanks everyone for your input 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants