System.Runtime.Serialization build conflict between versions and publicyKeyTokens

I have an old project that I opened at Visual Studio 2017. It starts to warn about a conflict in the System.Runtime.Serialization assembly.

The problem is that assembly versions have the same name but different publicyKeyToken.

Cannot resolve the conflict between "System.Runtime.Serialization, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089" and "System.Runtime.Serialization, Version = 2.0.5.0, Culture = neutral, PublicKeyToken = 7cec85d7bea7798e, Retargetable = Yes " The choice of "System.Runtime.Serialization, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089" is arbitrary.

I tried using some redirection combinations while working in my web.config, but could not get it to work.

+6
source share
2 answers

I had the same problem in several projects when compiling using VS 2017. VS 2015 did not report any problems. The warning disappeared after adding a link to System.Runtime.Serialization (4.0.0) to each of the projects with a warning.

+8
source

Try using the command update-package -reinstallin the package manager console.

+1
source

All Articles