25
votes

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?

2
Did you ever figure this out?Daniel Centore
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?Alexrgs
Possible duplicate of mscorlib version conflict during buildamin
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.Michael Woolsey
The mono version of mscorlib and a NuGet version is conflicting. Check your references to see where the mscorlib from NuGet is coming from.Jon Douglas

2 Answers

1
votes

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.

1
votes

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!!!