in src/Tasks/Microsoft.NET.Build.Tasks/AssetsFileResolver.cs [117:135]
private string GetDestinationSubDirectory(string libraryPath, string pkgRoot, string destPath = null)
{
if (_preserveStoreLayout && pkgRoot != null)
{
if (!libraryPath.StartsWith(pkgRoot))
{
throw new BuildErrorException(Strings.IncorrectPackageRoot, pkgRoot, libraryPath);
}
destPath = Path.GetDirectoryName(libraryPath.Substring(pkgRoot.Length));
}
if (destPath != null && destPath[destPath.Length - 1] != Path.DirectorySeparatorChar)
{
destPath += Path.DirectorySeparatorChar;
}
return destPath;
}