Open Jaykul opened 6 years ago
I was about to open an issue for what I observed with the Microsoft.Build.Utilities.Core
package...
PS> (Get-Package -Name 'Microsoft.Build.Utilities.Core').Dependencies
nuget:Microsoft.Build.Framework/16.0.461
nuget:Microsoft.VisualStudio.Setup.Configuration.Interop/1.16.30
nuget:System.Collections.Immutable/1.5.0
nuget:Microsoft.Build.Framework/16.0.461
nuget:Microsoft.Win32.Registry/4.3.0
nuget:System.Collections.Immutable/1.5.0
nuget:System.Text.Encoding.CodePages/4.0.1
The Microsoft.Build.Framework
and System.Collections.Immutable
dependencies are repeated. Looking at the <dependencies>
element of the .nuspec
file...
<dependencies>
<group targetFramework=".NETFramework4.7.2">
<dependency id="Microsoft.Build.Framework" version="16.0.461" exclude="Build,Analyzers" />
<dependency id="Microsoft.VisualStudio.Setup.Configuration.Interop" version="1.16.30" exclude="Build,Analyzers" />
<dependency id="System.Collections.Immutable" version="1.5.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="Microsoft.Build.Framework" version="16.0.461" exclude="Build,Analyzers" />
<dependency id="Microsoft.Win32.Registry" version="4.3.0" exclude="Build,Analyzers" />
<dependency id="System.Collections.Immutable" version="1.5.0" exclude="Build,Analyzers" />
<dependency id="System.Text.Encoding.CodePages" version="4.0.1" exclude="Build,Analyzers" />
</group>
</dependencies>
...we see the same dependencies in the same order, with Microsoft.Build.Framework
and System.Collections.Immutable
common to both groups. It seems that the Dependencies
property is just spitting out the <dependency />
elements it finds but, just as you say, without the needed context of the enclosing <group>
.
@LanceUMatthews Thanks for following up on this issue, we are able to repro
When I
Install-Package
and thenGet-Package
the returned object has aDependencies
property, but it has lost the crucial<group>
information!For instance, if we:
We get:
But I can't tell:
As an aside:
Regardless.
If my goal is to use this SemanticVersion assembly in PowerShell. I need one of those three versions:
For one of them, I have a dependency I need to import first. But for the other two, I have no dependencies!
We need for the
.Dependencies
property to preserve thetargetFramework
grouping, or it's basically useless, and I'm going to have to go pull the .nuspec file out of the package myself in order to figure out the dependency.