Skip to content

SDK doesn't honor TargetingPackVersion on FrameworkReference #3129

@ericstj

Description

@ericstj

SDK permits specifying TargetingPackVersion metdata on FrameworkReference:

if (frameworkReference != null)
{
// Allow targeting pack version to be overridden via metadata on FrameworkReference
targetingPackVersion = frameworkReference.GetMetadata("TargetingPackVersion");
}

But then it constructs the path to the targeting pack based on KnownFrameworkReference:

string targetingPackPath = null;
if (!string.IsNullOrEmpty(TargetingPackRoot))
{
targetingPackPath = Path.Combine(TargetingPackRoot, knownFrameworkReference.TargetingPackName, knownFrameworkReference.TargetingPackVersion);
}
if (targetingPackPath != null && Directory.Exists(targetingPackPath))
{
// Use targeting pack from packs folder
targetingPack.SetMetadata(MetadataKeys.PackageDirectory, targetingPackPath);
targetingPack.SetMetadata(MetadataKeys.Path, targetingPackPath);
}

Also, is this really the way we should be specifying which framework to build against? I had expected RuntimeFrameworkVersion to work, but it looks like that only controls the runtime and not ref-pack.

/cc @dsplaisted

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions