Skip to content

Commit

Permalink
supporting os version tfm for "-windows" (#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepchoudhery committed Jun 2, 2022
1 parent b780942 commit 0121bbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public IProjectContext Build()
{
_projectPath,
$"/t:EvaluateProjectInfoForCodeGeneration",
$"/p:OutputFile={tmpFile};CodeGenerationTargetLocation={_targetLocation};Configuration={_configuration}"
$"/p:OutputFile={tmpFile};CodeGenerationTargetLocation={_targetLocation};Configuration={_configuration}",
"-restore"
})
.OnErrorLine(e => errors.Add(e))
.OnOutputLine(o => output.Add(o))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ internal static IEnumerable<DependencyDescription> GetPackageDependencies(string
//"targets" gives us all top-level and transitive dependencies. "packageFolders" gives us the path where the dependencies are on disk.
if (root.TryGetProperty(TargetsProperty, out var targets) && root.TryGetProperty(PackageFoldersProperty, out var packageFolderPath))
{
if (targetFramework.EndsWith("-windows"))
{
//tfm in project.assets.json is netX-windows7.0 instead of netX-windows
targetFramework = $"{targetFramework}7.0";
}

if (targets.TryGetProperty(targetFramework, out var packages))
{
packageDependencies = DeserializePackages(packages, packageFolderPath, targetFrameworkMoniker);
Expand Down

0 comments on commit 0121bbc

Please sign in to comment.