How to resolve the conflict between 2 mscorlib versions in Visual Studio and Xamarin Studio?
Asked Answered
C

2

27

For more than 2 days I have been trying to fix this error, but I have not succeeded.

This is the error :

No way to resolve conflict between "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" and "mscorlib". Choosing "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" arbitrarily.

I searched about it and so many people had this problem, but I couldn't find a solution for it.

Finally, how can we find a way to resolve the conflict between these 2 references?

Caffrey answered 11/8, 2016 at 11:57 Comment(6)
Did you ever figure this out?Endoscope
As far I know it happens when you have two or more version of the same packages. did you try update-package -reinstall command at the Package Manager Console?Sonia
Possible duplicate of mscorlib version conflict during buildSmile
I had a similar problem that revolved around multiple projects in the same solution that were causing a conflict, even though all the nuget packages were up to date the issue persisted. Fortunately I was able to remove the offending project from the solution and the issue went away, not an ideal solution, but it worked for me.Agitprop
The mono version of mscorlib and a NuGet version is conflicting. Check your references to see where the mscorlib from NuGet is coming from.Dilapidation
doing the update-package -reinstall fixed the issue for me Actually i lie... the issue was due to installing asp.net core 2.0.8 but then downgrading it to 2.0.7 as the runtime was not yet available for download to support 2.0.8Paske
D
2

Issue I Faced: No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral,...............

Till now I have not succeeded in finding out the root cause, but I followed the steps to resolve the issue,

  1. Open Android device manager, and try starting the android simulator of interest.
  2. If it launches and states some error: stating to do a "Factory Reset", Stop the simulator and do the same.
  3. Try Starting the Simulator, it works.

Hope this works for you too!!!

Diego answered 2/2, 2020 at 12:59 Comment(0)
P
1

I don't have an answer but can provide the following:

  1. I have a blank Xamarin.Forms app targeted only to Android. I can build and deploy this one without any errors.
  2. I downloaded a Xamarin.Forms example from the Xamarin website and kept only the Android version. In this case I can rebuild the solution without any errors; however, when I try Start Without Debug, I get the exact error you report.

From these results I gather the following:

  1. The conflict between mscorlib versions is not related to the configuration of Visual Studio 17 but to the configuration of the app.
  2. The second of the links you included mentions installing a specific version of newtonsoft.json. Since this is a Nuget package, I thought that the problem would be with specific versions of these packages. Both of my apps use the same packages, but maybe the debug process doesn't necessarily use the same features of those packages.

I hope this helps.

Polychaete answered 30/11, 2018 at 4:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.