Improved support for NuGet packages with multiple targets - based on #381