Skip to content

Restore Microsoft.DotNet.TemplateLocator NuGet packaging on main#54394

Open
Copilot wants to merge 1 commit into
mainfrom
copilot/port-change-to-main-54329
Open

Restore Microsoft.DotNet.TemplateLocator NuGet packaging on main#54394
Copilot wants to merge 1 commit into
mainfrom
copilot/port-change-to-main-54329

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

Microsoft.DotNet.TemplateLocator stopped producing a NuGet package after pack-related project settings were removed in a prior branch prep change. This PR ports the release/10.0.1xx fix to main so TemplateLocator package publication behavior is restored.

  • Packability restored

    • Reintroduces IsPackable for the project.
    • Adds source-build guard to keep pack disabled during DotNetBuild pass 1 (avoids incomplete multi-TFM package outputs in that phase).
  • Project-reference outputs restored in package

    • Reattaches CopyProjectReferencesToPackage to TargetsForTfmSpecificBuildOutput.
    • Restores packaging of managed ProjectReference copy-local outputs into BuildOutputInPackage.
  • Representative project-file change

    <IsPackable>true</IsPackable>
    <IsPackable Condition="'$(DotNetBuild)' == 'true' and '$(DotNetBuildPass)' != '2'">false</IsPackable>
    <TargetsForTfmSpecificBuildOutput>
      $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage
    </TargetsForTfmSpecificBuildOutput>
    
    <Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences">
      <ItemGroup>
        <BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
      </ItemGroup>
    </Target>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores NuGet packaging behavior for Microsoft.DotNet.TemplateLocator on main after prior project settings changes stopped producing the package.

Changes:

  • Re-enables packing via IsPackable, while disabling pack during DotNetBuild pass 1 to avoid incomplete multi-TFM outputs.
  • Ensures project-reference copy-local outputs are included in the NuGet package by adding a TFM-specific packaging target.

Agent-Logs-Url: https://github.com/dotnet/sdk/sessions/3bfa1b39-6c77-44b5-af97-01cbea1f1638

Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
@marcpopMSFT marcpopMSFT force-pushed the copilot/port-change-to-main-54329 branch from f2f1c85 to f79ddea Compare May 22, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants