I’m trying to build a class library that includes some platform-specific stuff, i.e. there will be multiple targets including iOS and Android in one package.
As I understand it, there are basically two ways to go:
.csprojfile with multiple TargetFrameworks. There is a Xamarin example using this approach in the article “Multi-targeting the world: a single project to rule them all”. I think it is probably out of date– when I try to build according to that example, I get errors about the various
Targetsfiles not existing at the right path. But I at least understand the basic idea.
.csprojfiles, one for each target framework, with a
.nuprojfile to gather them together into a package, as described in these Microsoft docs. I’ve managed to set up a project like this and almost get it to build, although I’m still having a few problems.
I’m just wondering if one approach has clear advantages versus the other, and if there are any better examples of a solution like this that I’ve overlooked.