Place file-based app artifacts into repo's artifacts dir if used - #55697
Merged
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. 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 addresses #55692 by ensuring file-based apps don’t collapse into a shared artifacts/bin/<configuration>/ directory when a surrounding repo enables artifacts output layout. It does this by introducing a file-based-app-specific artifacts path property that only flows into ArtifactsPath when the repo hasn’t already configured artifacts output.
Changes:
- Introduces
FileBasedAppArtifactsPathand maps it toArtifactsPathonly whenArtifactsPathisn’t already set (allowing repo-levelUseArtifactsOutputto win). - Updates the file-based app virtual project to emit
FileBasedAppArtifactsPath(instead of settingArtifactsPathdirectly) and relies on the MSBuild props to set publish/pack outputs when appropriate. - Adds/updates tests for file-based app artifacts placement and updates docs to reflect artifacts-output-layout behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs | Updates test project XML to use FileBasedAppArtifactsPath instead of directly setting ArtifactsPath. |
| test/dotnet.Tests/CommandTests/Run/RunFileTests_BuildCommands.cs | Adds coverage for default (global/temp) artifacts behavior and repo artifacts-output-layout reuse behavior. |
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.DefaultArtifactsPath.props | Adds MSBuild logic to consume FileBasedAppArtifactsPath when ArtifactsPath is otherwise unset. |
| src/Tasks/Microsoft.NET.Build.Tasks/sdk/UseArtifactsOutputPath.props | Ensures the artifacts path props import happens when FileBasedAppArtifactsPath is present. |
| src/Cli/Microsoft.DotNet.FileBasedPrograms/VirtualProjectBuilder.cs | Emits FileBasedAppArtifactsPath in the virtual project file instead of ArtifactsPath (avoids overriding repo artifacts layout). |
| documentation/general/dotnet-run-file.md | Documents that file-based apps use repo artifacts layout when enabled, otherwise use the global/temp artifacts directory. |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
333fred
approved these changes
Aug 12, 2026
This was referenced Aug 27, 2026
This was referenced Sep 8, 2026
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.
Fixes #55692.