Q:

Conflict of the assembly System.Runtime.Serialization between versions and publicyKeyTokens

I have an old project that I opened on Visual Studio 2017.
It starts to warning about a conflict in the assembly System.Runtime.Serialization.
The problem here is that the assembly versions have both the same name but different publicyKeyToken.

No way to resolve 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". Choosing "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.

I tried put some runtime redirect combinations in my web.config but couldn't get it to work.

A:

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 reference to System.Runtime.Serialization (4.0.0) to each of the projects with the warning.

