You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make winapp run output as clean as dotnet build - #1037
Independent of #1032. The FluentStore output and recording below were captured with #1032 applied, because FluentStore only builds with that fix: on main alone it fails with APPX1101, before and after this PR. The output changes here apply either way.
Description
On an interactive terminal, winapp run <project> printed much more than dotnet build for the same build:
Every warning appeared twice, once inline and once in the summary. winapp let the build restore itself, so it had to stream the build through the classic logger (-tl:off) to redact authenticated NuGet feed URLs.
When a whole-solution restore failed (for example, a solution that lists projects from an uninitialized git submodule), winapp restored every listed project one at a time. Each one printed a banner, a long wrapped dotnet restore command and NuGet output, and the missing projects each failed with MSB1009.
The full injected dotnet command was printed for every step.
Now:
Interactive terminal: restore runs on its own, through winapp (feed credentials stay redacted), behind a spinner. It reports one line plus any warnings, once each. The build then runs with --no-restore and dotnet's terminal logger, so it looks exactly like dotnet build: one line per project, each warning once, one summary line.
Solutions: projects that aren't on disk are skipped with one note. The solution's other .NET projects restore in a single invocation through a temporary solution filter (.slnf) that lists only the projects winapp resolved to local files, so missing, native and UNC entries are left out. The solution itself is never handed to dotnet restore, so MSBuild can't open entries winapp skipped. A solution that lists .etp or %-escaped entries, which MSBuild would follow even through a filter, restores its projects one by one. winapp also retries project by project if the filtered restore fails for a reason other than a NuGet package error. A package error leaves the other projects restored, so retrying them would only repeat it.
Commands: full dotnet/MSBuild command lines appear only with --verbose, or after a step fails (Command: …) together with its full output. If the failed step was the solution-filter restore, winapp keeps the temporary .slnf so the printed command can be rerun.
Other modes:
Single-file (winapp run app.cs): behaves like a project on an interactive terminal. It restores through winapp with one summary line, then runs a --no-restore build with dotnet's terminal logger.
winapp pack and --aot: their restores use the same one-line summary on an interactive terminal. dotnet publish output still streams.
--no-restore: the build replays warnings from an earlier restore that winapp never saw, and those can quote a feed credential. So in both project and single-file mode it streams plain text through winapp's redaction.
C++: only the command display changed. A failure prints the exact MSBuild command.
Agents, CI and redirected output: still get plain streamed text.
--json and --quiet:--json keeps stdout pure JSON, with diagnostics and failed commands on stderr. --quiet stays quiet.
Redaction scope: dotnet gets the console only when nothing NuGet or winapp adds can quote a secret. That means a separate restore whose output needed no redaction, and no credential in the arguments. Otherwise the build streams through winapp's redaction. Text that a project's own targets choose to print appears as it would under dotnet build.
Usage Example
Observed in a real terminal, winapp run .\FluentStore.App --no-launch on FluentStore. FluentStore's .sln lists 4 projects from an uninitialized submodule. The warnings come from FluentStore itself and also appear in dotnet build. Long lines are trimmed with ….
Before (80 columns, incremental build):
🔎 FluentStore.App.csproj · Debug | arm64 · FluentStore.sln
🔄 Restoring FluentStore.sln dependencies...
dotnet restore D:\FluentStore\FluentStore.sln -p:Configuration=Debug
-p:SolutionDir=D:\FluentStore\ -p:SolutionPath=D:\FluentStore\FluentStore.sln
-p:SolutionName=FluentStore -p:SolutionFileName=FluentStore.sln
-p:SolutionExt=.sln
…NuGet.targets(521,5): error MSB3202: The project file "…\Cabinet.csproj" was not found. […]
(×4)
⚠ Solution restore failed (exit code 1); retrying managed dependencies
individually.
🔄 Restoring Microsoft.Marketplace.Storefront.Contracts.csproj dependencies...
dotnet restore
D:\FluentStore\API\MicrosoftStore\Microsoft.Marketplace.Storefront.Contracts.csp
roj -p:Configuration=Debug -p:Platform=arm64 -p:SolutionDir=D:\FluentStore\
…
Determining projects to restore...
All projects are up-to-date for restore.
… the same block for every listed project, NU1901 repeated each time, and
MSB1009 "Project file does not exist" for each submodule project …
🔧 Building FluentStore.App.csproj (Debug | arm64)...
dotnet build D:\FluentStore\FluentStore.App\FluentStore.App.csproj -c Debug
-v minimal -tl:off -p:Platform=arm64 …
… every warning inline (full length), then all of them again after "Build succeeded." …
11 Warning(s)
0 Error(s)
✅ Built FluentStore.App in 11.9s
After (109 columns):
🔎 FluentStore.App.csproj · Debug | arm64 · FluentStore.sln
ℹ Skipping 4 projects listed in FluentStore.sln that aren't on disk
(API\UUPMediaCreator\src\Cabinet\Cabinet.csproj and 3 more).
✅ Restored FluentStore.App and 20 solution projects with 2 warning(s) in 3.7s
D:\FluentStore\FluentStore.SDK\FluentStore.SDK.csproj : warning NU1901: Package 'NuGet.Packaging' 6.14.0 …
D:\FluentStore\FluentStore.SDK\FluentStore.SDK.csproj : warning NU1901: Package 'NuGet.Protocol' 6.14.0 …
🔧 Building FluentStore.App.csproj (Debug | arm64)...
…Microsoft.UI.Xaml.Markup.Compiler.BeforeCommon.targets(31,3): warning MSB4011: … (×4, evaluation warnings, as in dotnet build)
FluentStore.Services net8.0-windows10.0.22621.0 succeeded (0.1s) → …
…
FluentStore.SDK net8.0-windows10.0.22621.0 succeeded with 2 warning(s) (0.4s) → …
…warning NU1901: … (×2)
…
FluentStore.App net8.0-windows10.0.22621.0 succeeded with 3 warning(s) …
…warning NETSDK1198 / APPX0102 / APPX0107 …
Build succeeded with 9 warning(s) in 7.0s
✅ Built FluentStore.App in 7.2s
✅ 52374YoshiAskharoun.FluentStore_7sdtne7r32rbe registered (AUMID: …!App)
A failing step still shows everything needed to reproduce it. Here, the restore used a feed URL that carries a user name, password and sig= token, and all three are redacted:
…FailApp.csproj : error NU1301: Failed to retrieve information about 'Winapp.Does.Not.Exist' from remote source 'https://invalid.example/v3/index.json?<redacted>'.
Failed to restore …\FailApp.csproj (in 2.45 sec).
Command: dotnet restore …\FailApp.csproj -p:Configuration=Debug -p:Platform=arm64
-p:RestoreSources=https://invalid.example/v3/index.json?<redacted>
❌ Restore failed for 'FailApp.csproj' (exit code 1).
A build failure (-p WarningsAsErrors=NETSDK1198 on FluentStore) ends with Build failed with 1 error(s) and 8 warning(s), then Command: dotnet build … --no-restore … and ❌ Build failed for FluentStore.App.csproj (exit code 1).
Related Issue
Related to #1032: the FluentStore demo depends on it; the code doesn't.
Type of Change
🐛 Bug fix
🧪 Test update
📝 Documentation
Checklist
New tests added for new functionality (if applicable)
Shipped skills updated in plugins/winapp/skills/ (if CLI commands/workflows changed)
Screenshots / Demo
Recording in Windows Terminal at 140×42, all three on an incremental FluentStore build (with #1032 applied), back to back: (1) dotnet build .\FluentStore.App -p:Platform=arm64 for reference, (2) winapp run .\FluentStore.App --no-launch without this PR, (3) the same command with this PR. Watch the live behavior, not only the final screen: (2) scrolls through the restore cascade and a classic-logger build, while (3) shows one restore spinner line, then the same live per-project progress as (1).
winapp-run-output-before-after.mp4
The final counts differ for a reason: dotnet build reports 11 warning(s) because its two restore warnings (NU1901) are counted in the build summary. This PR reports those two on the restore line and 9 warning(s) for the build; the build itself lists the same warnings in both.
Additional Notes
Validation (local, ARM64 dev box, unless noted). These ran on the earlier stacked branch, whose commits are the same apart from conflict resolutions in docs, the C++ build output and one sample assertion:
.\scripts\test-samples.ps1 -Samples winui-app,winui-solution,winui-unpackaged-app,wpf-app,dotnet-app -WinappPath .\artifacts: 51/51 passed. Successful runs no longer print the build command, so the winui-app assertion that reads it now runs with --verbose.
CI on the stacked branch (Build and Package): all validate-tests shards, all four project-arch shards, docs and UI e2e passed (run).
Full WinApp.Cli.Tests (Debug): one unrelated failure, AnalyzeDumpAsync_ManagedDumpWithDeepStack_DetectsStackOverflowShape ("the .NET runtime in the dump does not match the host architecture (Arm64)").
A solution listing an irregularly formatted UNC entry ("Evil" , "\\localhost\nonexistent$\Evil.csproj"; Release CLI build, --verbose): winapp restores only through the .slnf and never runs dotnet restore App.sln; the entry never appears in the output, and the app builds.
A solution with a missing project and a sibling referencing a nonexistent package (published CLI): the solution-filter restore fails with NU1101. The .slnf named in the printed Command: line still exists after the failure, and rerunning that command reproduces NU1101.
PR CI (Build and Package, including samples and UI e2e) passed.
Project restores now pass -p:RuntimeIdentifier=<rid> alongside -r <rid>. dotnet restore -r only fills RuntimeIdentifiers, while dotnet build -r restores with RuntimeIdentifier set, so a RuntimeIdentifier-conditioned PackageReference was missing from the assets file a --no-restore build reads. For the same reason, the target always restores on its own rather than relying on a solution-scoped restore. Reproduced: restore -r win-arm64, then build -r win-arm64 --no-restore, fails with CS0103; with the property, it succeeds.
After the redaction and review follow-ups:
dotnet run --project src\winapp-CLI\WinApp.Cli.Tests\WinApp.Cli.Tests.csproj -c Release -- --filter "FullyQualifiedName~ProjectRunService|FullyQualifiedName~RunCommand|FullyQualifiedName~PackageCommand": 898/898 passed, and no winapp-restore-*.slnf files were left in %TEMP%.
Each new behavior test failed with its fix temporarily reverted: single-file redaction and separate restore, --json C++ and native MSIX Command: lines, and package preparation stopping on a solution package error.
With the .NET SDK 10.0.401 on a net10.0 project, --no-restore -f net8.0 fails with NETSDK1005 after an unpinned restore and builds after a restore pinned with -p:TargetFramework. A multi-targeting project also builds.
Real terminal: winapp run hello.cs --no-launch printed ✅ Restored hello in 0.8s, then dotnet's terminal logger (hello.cs net10.0 win-arm64 succeeded, Build succeeded in 0.5s).
On an interactive terminal, restore runs as its own redacted pass behind a
spinner and reports one line plus its warnings; the build then runs with
--no-restore so dotnet's terminal logger renders it. Solution siblings restore
in one invocation through a temporary solution filter that skips missing and
native projects. Full commands print only with --verbose or on failure.
Co-authored-by: Copilot App <[email protected]>
Other suites are reflected in the overall validation status above.
✅ 8413 passed, 37 skipped out of 8450 tests in 1318.7s (+37 tests, +258.8s vs. baseline)
Test Coverage
✅ 87.7% line coverage, 82.5% branch coverage · ✅ +0.1% vs. baseline
CLI Startup Time
64ms median (x64, winapp --version) · ✅ no change vs. baseline
Try This Build
Installs the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing.
Nikola Metulev (nmetulev)
added
ready-for-review
Agent work and technical checks complete; awaiting review or re-review, not approval or merge
agent-preparing
Agent is addressing feedback or completing required validation and CI
and removed
agent-preparing
Agent is addressing feedback or completing required validation and CI
ready-for-review
Agent work and technical checks complete; awaiting review or re-review, not approval or merge
labels
Oct 9, 2026
Failed commands are wrapped into invalid shell input.PrintFailedCommand renders through Spectre, which inserts physical newlines at the console width. For example, a failed run with a long temp path produced Command: dotnet build C:\...\0 followed by fb...\App.csproj on the next line; pasting that output into PowerShell does not rerun the command. This affects the new failure-command path in terminals and redirected/CI output. Write the command through the raw output writer (as restore diagnostics already do) so it remains one copyable line.
Spectre wrapped long commands at the console width, so the printed Command: line couldn't be pasted
back into a shell.
Co-authored-by: Copilot App <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The broad restore, redaction, and terminal-output changes need final human validation in a real interactive terminal despite passing 892 targeted Release tests.
The reason will be displayed to describe this comment to others. Learn more.
🤖 AI-generated review (winappcli pr-review skill) — verify before acting.
Thanks for the cleanup. The tests no longer leave .slnf files behind: 892/892 ProjectRunService/RunCommand/PackageCommand tests pass, with nothing left in %TEMP%.
One blocker from the new commits: the framework pin on the separate target restore breaks winapp run in a terminal when the app references a multi-targeted library (NETSDK1005). I reproduced it with the real binary in a console window. Details, a repro and a suggested fix are in the inline comment.
-p:TargetFramework is a global property, so it flowed to every ProjectReference and restored a
multi-targeted library (netstandard2.0;net8.0) only for the app's framework; the --no-restore build then
failed with NETSDK1005. dotnet build's own restore omits the framework too, and a framework the project
doesn't declare fails under plain dotnet build as well, so the pin fixed nothing.
Co-authored-by: Copilot App <[email protected]>
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
ready-for-reviewAgent work and technical checks complete; awaiting review or re-review, not approval or merge
3 participants
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.
Description
On an interactive terminal,
winapp run <project>printed much more thandotnet buildfor the same build:-tl:off) to redact authenticated NuGet feed URLs.dotnet restorecommand and NuGet output, and the missing projects each failed withMSB1009.dotnetcommand was printed for every step.Now:
--no-restoreand dotnet's terminal logger, so it looks exactly likedotnet build: one line per project, each warning once, one summary line..slnf) that lists only the projects winapp resolved to local files, so missing, native and UNC entries are left out. The solution itself is never handed todotnet restore, so MSBuild can't open entries winapp skipped. A solution that lists.etpor%-escaped entries, which MSBuild would follow even through a filter, restores its projects one by one. winapp also retries project by project if the filtered restore fails for a reason other than a NuGet package error. A package error leaves the other projects restored, so retrying them would only repeat it.dotnet/MSBuild command lines appear only with--verbose, or after a step fails (Command: …) together with its full output. If the failed step was the solution-filter restore, winapp keeps the temporary.slnfso the printed command can be rerun.winapp run app.cs): behaves like a project on an interactive terminal. It restores through winapp with one summary line, then runs a--no-restorebuild with dotnet's terminal logger.winapp packand--aot: their restores use the same one-line summary on an interactive terminal.dotnet publishoutput still streams.--no-restore: the build replays warnings from an earlier restore that winapp never saw, and those can quote a feed credential. So in both project and single-file mode it streams plain text through winapp's redaction.--jsonand--quiet:--jsonkeeps stdout pure JSON, with diagnostics and failed commands on stderr.--quietstays quiet.dotnet build.Usage Example
Observed in a real terminal,
winapp run .\FluentStore.App --no-launchon FluentStore. FluentStore's.slnlists 4 projects from an uninitialized submodule. The warnings come from FluentStore itself and also appear indotnet build. Long lines are trimmed with….Before (80 columns, incremental build):
After (109 columns):
A failing step still shows everything needed to reproduce it. Here, the restore used a feed URL that carries a user name, password and
sig=token, and all three are redacted:A build failure (
-p WarningsAsErrors=NETSDK1198on FluentStore) ends withBuild failed with 1 error(s) and 8 warning(s), thenCommand: dotnet build … --no-restore …and❌ Build failed for FluentStore.App.csproj (exit code 1).Related Issue
Related to #1032: the FluentStore demo depends on it; the code doesn't.
Type of Change
Checklist
plugins/winapp/skills/(if CLI commands/workflows changed)Screenshots / Demo
Recording in Windows Terminal at 140×42, all three on an incremental FluentStore build (with #1032 applied), back to back: (1)
dotnet build .\FluentStore.App -p:Platform=arm64for reference, (2)winapp run .\FluentStore.App --no-launchwithout this PR, (3) the same command with this PR. Watch the live behavior, not only the final screen: (2) scrolls through the restore cascade and a classic-logger build, while (3) shows one restore spinner line, then the same live per-project progress as (1).winapp-run-output-before-after.mp4
The final counts differ for a reason:
dotnet buildreports11 warning(s)because its two restore warnings (NU1901) are counted in the build summary. This PR reports those two on the restore line and9 warning(s)for the build; the build itself lists the same warnings in both.Additional Notes
Validation (local, ARM64 dev box, unless noted). These ran on the earlier stacked branch, whose commits are the same apart from conflict resolutions in docs, the C++ build output and one sample assertion:
.\scripts\build-cli.ps1 -SkipTests -SkipDocs: passed..\scripts\test-samples.ps1 -Samples winui-app,winui-solution,winui-unpackaged-app,wpf-app,dotnet-app -WinappPath .\artifacts: 51/51 passed. Successful runs no longer print the build command, so thewinui-appassertion that reads it now runs with--verbose.Invoke-Pester .\tests\project-arch\ProjectArch.Tests.ps1: 46/46 passed.WinApp.Cli.Tests(Debug): one unrelated failure,AnalyzeDumpAsync_ManagedDumpWithDeepStack_DetectsStackOverflowShape("the .NET runtime in the dump does not match the host architecture (Arm64)").After the rebase onto
main:dotnet run --project src\winapp-CLI\WinApp.Cli.Tests\WinApp.Cli.Tests.csproj -c Release -- --filter "FullyQualifiedName~ProjectRunService|FullyQualifiedName~RunCommand|FullyQualifiedName~PackageCommand": 878/878 passed."Evil" , "\\localhost\nonexistent$\Evil.csproj"; Release CLI build,--verbose): winapp restores only through the.slnfand never runsdotnet restore App.sln; the entry never appears in the output, and the app builds.NU1101. The.slnfnamed in the printedCommand:line still exists after the failure, and rerunning that command reproducesNU1101.mainwith this PR, in a real terminal: one restore line, then dotnet's terminal logger. The build then fails with APPX1101, the bug Fix winapp run/package building a referenced library twice (APPX1101/PRI252) #1032 fixes, followed byCommand: dotnet build ….Project restores now pass
-p:RuntimeIdentifier=<rid>alongside-r <rid>.dotnet restore -ronly fillsRuntimeIdentifiers, whiledotnet build -rrestores withRuntimeIdentifierset, so aRuntimeIdentifier-conditionedPackageReferencewas missing from the assets file a--no-restorebuild reads. For the same reason, the target always restores on its own rather than relying on a solution-scoped restore. Reproduced:restore -r win-arm64, thenbuild -r win-arm64 --no-restore, fails with CS0103; with the property, it succeeds.After the redaction and review follow-ups:
dotnet run --project src\winapp-CLI\WinApp.Cli.Tests\WinApp.Cli.Tests.csproj -c Release -- --filter "FullyQualifiedName~ProjectRunService|FullyQualifiedName~RunCommand|FullyQualifiedName~PackageCommand": 898/898 passed, and nowinapp-restore-*.slnffiles were left in%TEMP%.--jsonC++ and native MSIXCommand:lines, and package preparation stopping on a solution package error.net10.0project,--no-restore -f net8.0fails with NETSDK1005 after an unpinned restore and builds after a restore pinned with-p:TargetFramework. A multi-targeting project also builds.winapp run hello.cs --no-launchprinted✅ Restored hello in 0.8s, then dotnet's terminal logger (hello.cs net10.0 win-arm64 succeeded,Build succeeded in 0.5s).