0
votes

I have a Xamarin Forms app which was built with PCL.

When installing NuGet packages I would see all packages installed in NuGet Explorer.

Example Android Project:

Xam.Plugin.Geolocator **5.0.0.187-beta**

It might rely on the following NuGets:

enter image description here

However, when I install Xam.Plugin.Geolocator in the .NET Standard 2.0 solution I don't see the other plugins in the Nuget Package Explorer like I did in PCL project.

Regardless, the Forms App works just fine. Why don't the dependency package show up anymore? How can I know what version of the dependency packages I have installed?

I've gone ahead and manually installed them to the .NET Standard project, but that doesn't feel correct...

Additionally, I've noticed there is no longer a Packages folder in any of my Projects.

In my PCL Solution, I could see the dependencies. See Below:

enter image description here

1

1 Answers

2
votes

There should be a Dependencies - NuGet folder for a .NET Standard SDK style project. There is no Packages folder for an SDK style project.

You can expand the Dependencies - NuGet folder items to see the dependencies. If there are no child nodes then there are no dependencies.

You can also see more detailed information in the project.assets.json file which is created in the obj directory after restoring the NuGet packages.

Xam.Plugin.Geolocator has just the .NET Standard.Library NuGet package as a dependency if you are installing it into a .NET Standard project. This NuGet package would be referenced by default in a .NET Standard project. When I install that into a .NET Standard 2.0 project in Visual Studio 2017 it shows no dependencies.

The full set of dependencies taken from the .nuspec file is:

<dependencies>
  <group targetFramework=".NETFramework0.0" />
  <group targetFramework="Windows0.0" />
  <group targetFramework="WindowsPhone0.0" />
  <group targetFramework="WindowsPhoneApp0.0" />
  <group targetFramework=".NETStandard1.0">
    <dependency id="NETStandard.Library" version="1.6.1" />
  </group>
  <group targetFramework="MonoAndroid1.0">
    <dependency id="Xamarin.GooglePlayServices.Location" version="60.1142.0" />
    <dependency id="Plugin.Permissions" version="2.2.1" />
  </group>
  <group targetFramework="Xamarin.iOS1.0">
    <dependency id="Plugin.Permissions" version="2.2.1" />
  </group>
  <group targetFramework="Xamarin.Mac2.0" />
  <group targetFramework=".NETPortable0.0-Profile259" />
  <group targetFramework="UAP0.0" />
  <group targetFramework=".NETPlatform5.0" />
  <group targetFramework="Xamarin.TVOS0.0" />
  <group targetFramework="Xamarin.WatchOS0.0" />
</dependencies>

If you try other NuGet packages, such as say AutoMapper, then you will dependencies when you expand the Dependencies - NuGet - AutoMapper item in the Solution Explorer.