Propagate the PackageReference version into the C# wapproj template's BlankApp project file - #6705
Open
Lauren Ciha (lauren-ciha) wants to merge 8 commits into
Open
Conversation
Lauren Ciha (lauren-ciha)
requested review from
Dinah Xiaoman G (DinahK-2SO)
and
a lite review from Copilot
August 19, 2026 20:36
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes version propagation in the C# packaged-app VS template so the BlankApp project resolves its NuGet PackageReference versions correctly when instantiated, and adds guardrails to local VSIX build scripts (MSBuild version selection + VSIX template-content validation).
Changes:
- Add
ext_-prefixed template parameters for Windows App SDK / BuildTools package versions and update the BlankApp template csproj to consume them. - Add an
MsBuildVersionparameter to local VSIX build/install scripts and use it to select the matching MSBuild viavswhere. - Enhance
Test-DotnetNewTemplates.ps1to fall back todotnet package searchwhenSYSTEM_ACCESSTOKENis unavailable.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| dev/Templates/VSIX/build-local-VSIX-package/Build-VSIX-Local.ps1 | Adds MSBuild major-version selection and validates generated VSIX contains templates. |
| dev/Templates/VSIX/build-local-VSIX-package/build-install-localdev-vsix.ps1 | Plumbs MSBuild major-version selection into the end-to-end local build+install loop. |
| dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.vstemplate | Introduces custom parameters for package version propagation to linked templates. |
| dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj | Consumes propagated ext_ parameters for NuGet package versions. |
| dev/Templates/Dotnet/Test-DotnetNewTemplates.ps1 | Adds non-pipeline fallback for determining latest official Microsoft.WindowsAppSDK version. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Member
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
…uildToolsWinAppVersion to {name}$ (parent template parameter) instead of project template parameter
…dedVersionPrefixes to 2.63
…ate Extract-VersionFromNupkg to Find-VersionFromNupkg
Lauren Ciha (lauren-ciha)
force-pushed
the
user/laurenciha/add-blankapp-template-parameters-to-vs
branch
from
August 26, 2026 17:43
2f535e9 to
d264a99
Compare
Member
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR corrects a bug where the wapproj's BlankApp project failed to resolve the floating package reference for its NuGet dependencies. The problem was that the
$WindowsAppSdkVersion$,$WindowsSdkBuildToolsVersion$, and$WindowsSdkBuildToolsWinAppVersion$were passed into the BlankApp.csproj file directly when the variable comes from the parent project. The fix was to prependext_to the variable name so the VS template engine could substitute the variables as expected.I verified this fix locally using
dev\Templates\VSIX\build-local-VSIX-package\build-install-localdev-vsix.ps1with MSBuild 17 (from Visual Studio 2022) and manually verifying that the template built and deployed on Visual Studio 2026. I chose to use MSBuild 17 because there is a bug in MSBuild 18 where template projects are built, but not included in the VSIX file. To work around this bug in the future, I added a check inbuild-vsix-local.ps1to verify that the correct number of templates were included in the VSIX and anMSBuildVersionparameter to select the MSBuild version to test.A microsoft employee must use /azp run to validate using the pipelines below.
WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.
For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.