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

forward to correct package name #129

Merged
merged 1 commit into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is VB needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question, I think this is unnecessay but I'll check


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