Skip to content

Produce standalone TemplateLocator package in pass 2 - #54560

Merged
marcpopMSFT merged 2 commits into
dotnet:mainfrom
emaf:csdevkit/templatelocator-package-fix
Jun 8, 2026
Merged

marcpopMSFT merged 2 commits into
dotnet:mainfrom
emaf:csdevkit/templatelocator-package-fix

Conversation

@emaf

@emaf emaf commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Schedule Microsoft.DotNet.TemplateLocator as a top-level pass-2 project in product builds so the standalone TemplateLocator NuGet package is produced alongside the VS redist layout package.

Motivation

Microsoft.DotNet.TemplateLocator.csproj is packable only during DotNetBuildPass=2, but it was only being built as a dependency of the VS redist layout project. That produced VS.Redist.Common.Net.Core.SDK.VSTemplateLocator, but did not produce the standalone TemplateLocator package.

Validation

Validated on Windows x64 with a pass-2 product-style pack:

build.cmd -pack /p:DotNetBuild=true /p:DotNetBuildPass=2 /p:TargetOS=windows /p:TargetArchitecture=x64

Confirmed both packages are produced:

  • artifacts\packages\Debug\NonShipping\Microsoft.DotNet.TemplateLocator.11.0.100-dev.nupkg
  • artifacts\packages\Debug\NonShipping\VS.Redist.Common.Net.Core.SDK.VSTemplateLocator.11.0.100-dev.nupkg

Also ran the local publish/manifest phase before the latest cleanup and confirmed the generated asset manifest contains TemplateLocator as a <Package> asset, not only the VS redist package.

Copilot AI review requested due to automatic review settings June 2, 2026 17:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates build/packaging metadata so Microsoft.DotNet.TemplateLocator is built in the second source-build pass (on win-x64) and explicitly sets its NuGet package identity.

Changes:

  • Set an explicit PackageId for Microsoft.DotNet.TemplateLocator.
  • Add Microsoft.DotNet.TemplateLocator.csproj to the pass-2 ProjectToBuild list for win-x64 product builds.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Microsoft.DotNet.TemplateLocator/Microsoft.DotNet.TemplateLocator.csproj Adds an explicit PackageId for packing/publishing.
eng/Build.props Builds TemplateLocator in DotNetBuildPass=2 alongside other dependent projects on win-x64.

@emaf

emaf commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

cc @marcpopMSFT @mmitche

@ViktorHofer ViktorHofer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume you can't use the existing VS.Redist.Common.Net.Core.SDK.VSTemplateLocator package that we already provide to VS?

@emaf

emaf commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

I assume you can't use the existing VS.Redist.Common.Net.Core.SDK.VSTemplateLocator package that we already provide to VS?

Yes, we technically could consume VS.Redist.Common.Net.Core.SDK.VSTemplateLocator, but it would be the wrong shape for C# Dev Kit. That package is a VS insertion/redist payload, not a normal library NuGet package.

C# Dev Kit needs to reference TemplateLocator through standard NuGet restore/publish flows. Using the VS redist package would mean adding custom logic to extract/copy the right files from its layout, and would couple us to VS packaging details instead of the TemplateLocator package contract.

@mmitche

mmitche commented Jun 3, 2026

Copy link
Copy Markdown
Member

C# Dev Kit needs to reference TemplateLocator through standard NuGet restore/publish flows. Using the VS redist package would mean adding custom logic to extract/copy the right files from its layout, and would couple us to VS packaging details instead of the TemplateLocator package contract.

@emaf Does this mean this package is moving to a shipping nuget.org package?

@emaf

emaf commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

C# Dev Kit needs to reference TemplateLocator through standard NuGet restore/publish flows. Using the VS redist package would mean adding custom logic to extract/copy the right files from its layout, and would couple us to VS packaging details instead of the TemplateLocator package contract.

@emaf Does this mean this package is moving to a shipping nuget.org package?

No, we just need this to be available in any (internal) feeds.

Just for context, C# Dev Kit already consumes and old version of this package that was produced by builds from the templating repo. The goal is to bring that back.

@emaf
emaf force-pushed the csdevkit/templatelocator-package-fix branch from 0ca3ef8 to d380e05 Compare June 4, 2026 18:51
Copilot AI and others added 2 commits June 8, 2026 09:51
Schedule Microsoft.DotNet.TemplateLocator as a pass-2 product build project and restore the historical NuGet package ID so official builds can pack and publish microsoft.dotnet.templateLocator again.

Co-authored-by: Copilot <[email protected]>
The default SDK pack identity already matches the project name, so keep the project file simpler while still producing the standalone TemplateLocator package in pass 2.

Co-authored-by: Copilot <[email protected]>
@emaf
emaf force-pushed the csdevkit/templatelocator-package-fix branch from d380e05 to 5dcced8 Compare June 8, 2026 13:51
@marcpopMSFT
marcpopMSFT merged commit 492e3fb into dotnet:main Jun 8, 2026
25 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants