With the introduction of the Portable Class Library, developers can release one library that is compatible across multiple platforms. The downside of this is that PCL should come down to the lowest common set of classes that are compatible across all of these platforms.
If you want to play into the strengths and functionality of certain platforms (or if you want to access classes that exist only on certain platforms), I assume that you must do one of the following:
- Release the “base” set of classes as a library of portable classes, with the appropriate platform-specific libraries that build on it.
- One example would be the MVVM library: release common base classes as one portable class library - "MyCustomMvvm.dll" - and release some additional platform functionality in the form of "MyCustomMvvm.Extras.WPF.dll" and "MyCustomMvvm.Extras.WPF. dll ", MyCustomMvvm.Extras.WP7.dll" etc. OR:
- Keep a separate project for each platform using the “linked” source files and #if statements to conditionally compile the platform’s functionality.
- In this example, all libraries will have the same file name ("MyCustomMvvm.dll"), but a separate copy will be created for each platform, built using a specific project as part of your solution.
My question is: are these two options? Is there a "better" option?
source share