What is the difference between PCL & Shared Project?

Technology CommunityCategory: XamarinWhat is the difference between PCL & Shared Project?
VietMX Staff asked 3 years ago
  • PCL has an output assembly as DLL while Shared Project has no output assembly.
  • Files inside PCL are treated as part of PCL while in Shared Project, files are treated as part of the referencing project and compiled into that assembly.
  • PCL contains neat and clean platform independent code while Shared Project consists of many #if compiler directives to differentiate code among platforms.
  • PCL is the best approach if good project architecture is the main concern instead of Shared Project.
  • PCL uses the Interfaces and DependencyServices to access platform specific features while Shared Project can assess them directly.
  • PCL has less compile time errors while Shared Project has many chances of compile time errors while switching among platform specific projects.
  • PCL is used if less platform specific code is required. Shared Project is used when lot of platform specific code is required. However, this is not true all the time. Choice is always on the developer.