Skip to content

Commit 5c7d4aa

Browse files
committed
Code cleanup
Handle scenario where related can contain ".Http.xml;.HttpListener.xml;.Mail.xml;.NameResolution.xml;.NetworkInformation.xml
1 parent 1722738 commit 5c7d4aa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageAssets.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using NuGet.Common;
1515
using NuGet.ProjectModel;
1616
using NuGet.Versioning;
17+
using static System.Net.Mime.MediaTypeNames;
1718

1819
namespace Microsoft.NET.Build.Tasks
1920
{
@@ -1165,11 +1166,12 @@ private void WriteDebugItems<T>(
11651166

11661167
asset.Properties.TryGetValue(MetadataKeys.RelatedProperty, out string relatedExtensions);
11671168

1168-
foreach (string fileExtension in relatedExtensions.Split(RelatedPropertySeparator))
1169+
foreach (string relatedExtension in relatedExtensions.Split(RelatedPropertySeparator))
11691170
{
1170-
if (fileExtension.ToLower() == extension)
1171+
string ext = Path.GetExtension(relatedExtension);
1172+
if (ext.ToLower() == extension)
11711173
{
1172-
WriteItem(Path.ChangeExtension(itemSpec, extension), library);
1174+
WriteItem(Path.ChangeExtension(itemSpec, relatedExtension), library);
11731175
}
11741176
}
11751177
}

0 commit comments

Comments
 (0)