Skip to content

Commit a339b08

Browse files
authored
Setting NuGetPackageId for UnpkgProvider and filtering null NuGetPackageId's from install steps. (#154)
1 parent 3595773 commit a339b08

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/LibraryManager.Vsix/Commands/RestoreOnBuildCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ private async Task ExecuteAsync(object sender, EventArgs e)
101101
try
102102
{
103103
var dependencies = Dependencies.FromConfigFile(projectItem.FileNames[1]);
104-
IEnumerable<string> packageIds = dependencies.Providers.Select(p => p.NuGetPackageId).Distinct();
104+
IEnumerable<string> packageIds = dependencies.Providers
105+
.Where(p => p.NuGetPackageId != null)
106+
.Select(p => p.NuGetPackageId)
107+
.Distinct();
105108

106109
if (!_isPackageInstalled)
107110
{

src/LibraryManager/Providers/Unpkg/UnpkgProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public UnpkgProvider(IHostInteraction hostInteraction)
2222

2323
public string Id => IdText;
2424

25-
public string NuGetPackageId => null;
25+
public string NuGetPackageId { get; } = "Microsoft.Web.LibraryManager.Build";
2626

2727
public IHostInteraction HostInteraction { get; }
2828

0 commit comments

Comments
 (0)