Skip to content

Place file-based app artifacts into repo's artifacts dir if used - #55697

Merged
jjonescz merged 4 commits into
dotnet:mainfrom
jjonescz:55692-sprint-reuse-artifacts
Aug 13, 2026
Merged

Place file-based app artifacts into repo's artifacts dir if used#55697
jjonescz merged 4 commits into
dotnet:mainfrom
jjonescz:55692-sprint-reuse-artifacts

Conversation

@jjonescz

Copy link
Copy Markdown
Member

Fixes #55692.

@jjonescz
jjonescz requested a lite review from Copilot August 10, 2026 12:56
@jjonescz jjonescz added the Area-run-file Items related to the "dotnet run <file>" effort label Aug 10, 2026
@azure-pipelines

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

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

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 FileBasedAppArtifactsPath and maps it to ArtifactsPath only when ArtifactsPath isn’t already set (allowing repo-level UseArtifactsOutput to win).
  • Updates the file-based app virtual project to emit FileBasedAppArtifactsPath (instead of setting ArtifactsPath directly) 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.

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@jjonescz
jjonescz requested a review from a team August 11, 2026 09:14
@jjonescz
jjonescz marked this pull request as ready for review August 11, 2026 10:56
@jjonescz
jjonescz requested a review from a team as a code owner August 11, 2026 10:56
@azure-pipelines

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

@jjonescz
jjonescz merged commit bbb124f into dotnet:main Aug 13, 2026
23 checks passed
@jjonescz
jjonescz deleted the 55692-sprint-reuse-artifacts branch August 13, 2026 07:54
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-run-file Items related to the "dotnet run <file>" effort

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File-based app artifacts output path is missing project name

3 participants