Skip to content

Latest SDK cannot pack itself #1730

@nguerrera

Description

@nguerrera

The Microsoft.NET.Build.Tasks.csproj has some code to resolve publish assemblies during the build phase in order to pack itself.

Triggering this code now causes the order of GetReferenceAssemblyPaths and GetFrameworkPaths to be reversed during pack. GetReferenceAssemblyPaths must always run after GetFrameworkPaths because GetReferenceAssemblyPaths overrides the TargetFrameworkDirectory set by GetFrameworkPaths.

Everywhere #1618 added DependsOnTargets="GetReferenceAssemblyPaths" needs to be DependsOnTargets="GetFrameworkPaths;GetReferenceAssemblyPaths"

Minimal repro (or just use Microsoft.NET.Build.Tasks.csproj):

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net46</TargetFramework>
  </PropertyGroup>
 <Target Name="Repro" DependsOnTargets="RunResolvePublishAssemblies" BeforeTargets="ResolveLockFileCopyLocalProjectDeps" />
</Project>
> dotnet pack
Microsoft (R) Build Engine version 15.5.178.35674 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 11.77 ms for D:\Temp\repro_pack\repro_pack.csproj.
  repro_pack -> D:\Temp\repro_pack\bin\Debug\net46\repro_pack.dll
C:\Program Files\dotnet\sdk\2.1.1-preview-007128\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.ConflictResolution.targets(58,5): error : Framework list file path 'v4.0.30319\RedistList\FrameworkList.xml' is not rooted. Only full paths are supported. [D:\Temp\repro_pack\repro_pack.csproj]

@livarcocc @dsplaisted

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions