Bug 45144 - Installing a Component does not add PCL as reference
Summary: Installing a Component does not add PCL as reference
Status: RESOLVED ANSWERED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Studio Integration ()
Version: N/A
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Matt Ward
URL:
Depends on:
Blocks:
 
Reported: 2016-10-07 05:00 UTC by Srihari Kulkarni
Modified: 2016-10-07 09:00 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Srihari Kulkarni 2016-10-07 05:00:52 UTC
When a component is installed into a project from the Component Store, the DLLs in the pcl folder are not added as reference to the project. 

On the Xamarin Component Submission Guide ( https://developer.xamarin.com/guides/cross-platform/advanced/submitting_components/component_submission_guide/), it says 

"You can specify libraries for each platform using the following specifiers, with the path to the dll as the value.
android: [path_to_dll]
ios-unified: [path_to_dll]
winphone-8.1: [path_to_dll]
pcl: [path_to_dll]
" 

However this is not the case with pcl.

Here is the response from Xamarin support (edited for brevity)

"
.....
Unfortunately, as it stands, the IDE doesn't process the "pcl" library folder when adding a component which is why they are not being attached.

This is something we are looking into but in the short term you have two choices.

1) Add the PCL library, Worklight.Core.dll in this case, to both the android and ios library folders. This will mean a duplication of the files, but i is the easiest route.
2) Use nuget for the libraries. This will allow you to package the files specifically for each platform including the pcl's. The details on how to do this can be found here - https://developer.xamarin.com/guides/cross-platform/advanced/submitting_components/components_and_nuget. 
"
Comment 1 Matt Ward 2016-10-07 09:00:42 UTC
Currently Xamarin Components do support a PCL directory but it is called "mobile" not "pcl". The documentation is incorrect.

However the logic is similar to NuGet so you would not get both assemblies referenced if they are in two different lib folders. Only the nearest match to the project's target framework would be used.

Examples:

Component has just a PCL:

  lib/mobile/MyPcl.dll

This will be referenced when the component is installed into an iOS or Android project or a Windows Phone project.

Component has a PCL and iOS:

   lib/mobile/MyPcl.dll
   lib/ios-unified/MyIOS.dll

Installing the above into an iOS unified project would reference the MyIOS.dll only. Installing it into an Android project would reference the MyPcl.dll.