Forum Cross Platform with Xamarin

Issue with resolving dependencies for Android and iOS class library

I have two Xamarin class libraries set up in a Visual Studio 2015 solution, one of which is an Android class library, the other one is an iOS one. I am trying to install the Microsoft.Rest.ClientRuntime (v2.3.4) NuGet package into both of these libraries. However, it will then try to also add all of the package's dependencies (e.g. System.Collections, System.Diagnostics, etc.) to my class libraries, although these assemblies are already part of my class library projects.

What I am trying to understand is why is NuGet not properly resolving the package's dependencies? Why do I have to add all of them in there, although they are already part of my libraries? Is this by design? If so, why and how do I get around this?

I have set dependency behavior to "lowest". I don't want to set it to "ignore dependencies" in NuGet package manager since on another effort I have a scenario where I created my own NuGet package that has Microsoft.Rest.ClientRuntime 2.3.4 and some additional packages as dependencies.

Anything that could point me in the right direction would be most helpful to me. Thanks!

Answers

  • PatrykRomanczukPatrykRomanczuk PLMember ✭✭

    It surely looks strange but check if nuget package that you try to install does not require higher versions of dependencies than one you have included in your project. Also check if this nuget package is compatibile with your project setup.

  • What do you mean by "check if the package requires higher versions of dependencies"? The package has a list of dependencies, each of which has the version defined that it needs. Also, the NuGet package is compatible with my project setup, otherwise I wouldn't be able to install it.

Sign In or Register to comment.