Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 726
Thiago Romam Avatar asked May 26 '17 11:05

Thiago Romam


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

like image 186
Finn Kjær Rasmussen Avatar answered Nov 19 '22 05:11

Finn Kjær Rasmussen


Try to use update-package -reinstall command in the Package Manager Console.

like image 27
Maxim Kitsenko Avatar answered Nov 19 '22 05:11

Maxim Kitsenko