PCL best practices

FlyshewoorstFlyshewoorst DEMember ✭✭
edited October 2016 in Cross Platform with Xamarin

Hi everyone,

I'm currently evaluating Xamarin for my company. I did some tests, played around with all of the possible structures. I come from the Java-world, I've learned much about the advantages of Dependency Injection; so eventually one of the most important things for me was to find a suitable Dependency Injection framework (finally did; seems that DryIoc is a pretty good choice).

Coming from the Java world, I'm used to Maven, which partially does the same job as NuGet does, which leads me to my actual question. My project structure looks like this:

Solution |--pcl.business |--packages: |--DryIoc.dll |--Newtonsoft.Json |... |--droid |--ios
I was wondering if there is any possibility to declare pcl.business as some kind of root project to inherit it's dependencies (being DryIoc.dll, Newtonsoft.Json as well as packages I'm going to add within the future) within droid and ios?

If not, what is the best practice to manage this?

Best Answers

Answers

  • kentuckerkentucker USMember ✭✭✭✭✭

    Right click on the solution in Visual Studio and select manage nuget packages for solution. It should add the package to all the projects in the solution

  • FlyshewoorstFlyshewoorst DEMember ✭✭
    edited October 2016

    I'm using Xamarin Studio at the moment. Can this be done via CLI or do I have to switch to VS for tasks like this?

  • mattwardmattward GBMember Xamurai

    The way you are using NuGet you may want to take a look at Paket which is a command line application that supports adding NuGet packages to projects. It has better command line support than NuGet. There is a Paket addin available for Xamarin Studio 6.1.

    What gets shipped in your bundled application depends on what is in the NuGet package. If the same assembly from the NuGet package is being used in all the projects then it would only get added once. If you take a look at your bin/Debug directory you will see what assemblies are being used. In the DryIod.Dll NuGet package only one copy if its .dll should be used.

Sign In or Register to comment.