in src/Microsoft.NuGet.Build.Tasks/ResolveNuGetPackageAssets.cs [314:357]
private void GetCopyLocalItems(JObject lockFile)
{
// If we have no runtime identifier, we're not copying implementations
if (string.IsNullOrEmpty(RuntimeIdentifier))
{
return;
}
// We'll use as a fallback just the target moniker if the user didn't have the right runtime identifier in their lock file.
var target = GetTargetOrAttemptFallback(lockFile, needsRuntimeIdentifier: true);
HashSet<string> candidateNativeImplementations = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
List<ITaskItem> runtimeWinMDItems = new List<ITaskItem>();
foreach (var package in GetPackagesFromTarget(lockFile, target))
{
foreach (var nativeItem in CreateItems(package, NuGetAssetTypeNative))
{
if (Path.GetExtension(nativeItem.ItemSpec).Equals(".dll", StringComparison.OrdinalIgnoreCase))
{
candidateNativeImplementations.Add(Path.GetFileNameWithoutExtension(nativeItem.ItemSpec));
}
_copyLocalItems.Add(nativeItem);
}
foreach (var runtimeItem in CreateItems(package, NuGetAssetTypeRuntime))
{
if (Path.GetExtension(runtimeItem.ItemSpec).Equals(".winmd", StringComparison.OrdinalIgnoreCase))
{
runtimeWinMDItems.Add(runtimeItem);
}
_copyLocalItems.Add(runtimeItem);
}
foreach (var resourceItem in CreateItems(package, NuGetAssetTypeResource))
{
_copyLocalItems.Add(resourceItem);
}
}
SetWinMDMetadata(runtimeWinMDItems, candidateNativeImplementations);
}