Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #129 from jmarolf/bugix/fix-packages
Browse files Browse the repository at this point in the history
forward to correct package name
  • Loading branch information
jmarolf authored Nov 11, 2019
2 parents 5641c01 + 74e5487 commit 33daecc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/MSBuild.Abstractions/NugetHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.VisualBasic;

namespace MSBuild.Abstractions
{
Expand Down Expand Up @@ -42,5 +44,15 @@ static string GetVersionFromQueryResponse(Stream result)
return null;
}
}

public static string FindPackageNameFromReferenceName(string referenceName)
{
if (StringComparer.OrdinalIgnoreCase.Compare(referenceName, "System.ComponentModel.DataAnnotations")==0)
{
return "System.ComponentModel.Annotations";
}

return referenceName;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static IProjectRootElement RemoveOrUpdateItems(this IProjectRootElement p
}
else if (ProjectItemHelpers.IsReferenceConvertibleToPackageReference(item))
{
var packageName = item.Include;
string packageName = NugetHelpers.FindPackageNameFromReferenceName(item.Include);
string version = null;
try
{
Expand Down

0 comments on commit 33daecc

Please sign in to comment.