How to Add Platform-Specific Files to NuGet Package (.NET Standard Library)

DFoulkDFoulk USMember ✭✭

Hi Guys!

I am attempting to create a NuGet package for our team that is a Xamarin.Forms theme for our corporate apps.

Currently, the package contains a XAML file that houses a ResourceDictionary (our Xamarin.Forms styles).

With this package, we can:

  1. Install the NuGet package (XAML styles for Xamarin.Forms)
  2. Manually edit OurApp.Android\Resources\values\styles.xml (and colors.xml)
  3. Get on with life

However, we want to eliminate the need for Step 2. We want to add the styles.xml & colors.xml files to our NuGet package, so that when the NuGet package is installed- these files are added/updated automatically.

How can we accomplish this using the attached solution?

Note: Part of the confusion is that we have converted our NuGet projects to .NET Standard. It is unclear how to create a NuGet package from a .NET Standard Library that includes files from a different (non-.NET Standard) project...

Any help is appreciated! Thanks...

Sign In or Register to comment.