Skip to content

Produce standalone TemplateLocator package in pass 2#54560

Open
emaf wants to merge 2 commits into
dotnet:mainfrom
emaf:csdevkit/templatelocator-package-fix
Open

Produce standalone TemplateLocator package in pass 2#54560
emaf wants to merge 2 commits into
dotnet:mainfrom
emaf:csdevkit/templatelocator-package-fix

Conversation

@emaf
Copy link
Copy Markdown

@emaf emaf commented Jun 2, 2026

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
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

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.

Comment thread src/Microsoft.DotNet.TemplateLocator/Microsoft.DotNet.TemplateLocator.csproj Outdated
@emaf
Copy link
Copy Markdown
Author

emaf commented Jun 2, 2026

cc @marcpopMSFT @mmitche

Copy link
Copy Markdown
Member

@ViktorHofer ViktorHofer left a comment

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
Copy link
Copy Markdown
Author

emaf commented Jun 2, 2026

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
Copy link
Copy Markdown
Member

mmitche commented Jun 3, 2026

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
Copy link
Copy Markdown
Author

emaf commented Jun 3, 2026

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.

Copilot AI and others added 2 commits June 4, 2026 14: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 <223556219+Copilot@users.noreply.github.com>
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 <223556219+Copilot@users.noreply.github.com>
@emaf emaf force-pushed the csdevkit/templatelocator-package-fix branch from 0ca3ef8 to d380e05 Compare June 4, 2026 18:51
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