Home > database >  Which project(s) to install shared libraries in Xamarin App
Which project(s) to install shared libraries in Xamarin App

Time:03-05

I want to use a shared class library from my backend API in my Xamarin Forms 5 app. This library mostly contains some util functions and I have it as a NuGet package.

Do I need to install this package on all three projects or just the main project where I have my code and where I'll be using it?

I read some articles and watched some videos and got some conflicting answers. In some cases, packages are installed onto all three projects but other times only onto the main one. I'm sure there's some logic to this. I'd appreciate someone telling me how to determine where to install NuGet packages like mine?

CodePudding user response:

if it's just a .NET library, install it in your .NET project where all the Forms code is

nugets that are installed in multiple projects typically contain multiple libraries - iOS, Android and .NET, and nuget installs the appropriate library in each one

  • Related