I have a solution with 2 projects:
The netcoreapp3.1 project references the library one. The library project makes use of the System.Text.Json
APIs. When I build the solution I get the following error:
Assembly 'System.Text.Json' with identity 'System.Text.Json, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' uses 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I tried explicitly installing the System.Text.Json 4.7.2 into the netstandard2.1 project. The app now compiles and works. However, during build process I get a few warnings like this:
##[warning]/usr/share/dotnet/sdk/5.0.101/Microsoft.Common.CurrentVersion.targets(2123,5): Warning MSB3243: No way to resolve conflict between "System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "System.Text.Json, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51". Choosing "System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" arbitrarily.
What am I doing wrong?
Here is perhaps a better answer.
Downgrade Microsoft.Extensions.Configuration.Json
to 3.1.1 as in my screenshot.
Thanks to this github issue workaround.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With