How to exclude some directories from imported nuget package in a Xamarin (VS) project


I’m working on a mobile application in xamarin, which uses certain third party nuget package, and I would like to prevent some of the directories from that nuget package being included in final release, but I can’t find any information on how to exclude specific files/folders from an imported, third party nuget package. (specifically I would like some of the localisation folders from the package not being copied to the output directory)

I’m using package reference format.


The solution is to add a post-build step with a simple bash command removing all of the unwanted directories.

Answered By – hr4bi0

Leave a Comment