Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
Handle scenario where related can contain ".Http.xml;.HttpListener.xml;.Mail.xml;.NameResolution.xml;.NetworkInformation.xml
  • Loading branch information
ocalles committed Sep 1, 2022
1 parent 1722738 commit 5c7d4aa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Tasks/Microsoft.NET.Build.Tasks/ResolvePackageAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using NuGet.Common;
using NuGet.ProjectModel;
using NuGet.Versioning;
using static System.Net.Mime.MediaTypeNames;

namespace Microsoft.NET.Build.Tasks
{
Expand Down Expand Up @@ -1165,11 +1166,12 @@ private void WriteDebugItems<T>(

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

foreach (string fileExtension in relatedExtensions.Split(RelatedPropertySeparator))
foreach (string relatedExtension in relatedExtensions.Split(RelatedPropertySeparator))
{
if (fileExtension.ToLower() == extension)
string ext = Path.GetExtension(relatedExtension);
if (ext.ToLower() == extension)
{
WriteItem(Path.ChangeExtension(itemSpec, extension), library);
WriteItem(Path.ChangeExtension(itemSpec, relatedExtension), library);
}
}
}
Expand Down

0 comments on commit 5c7d4aa

Please sign in to comment.