Skip to content

File-based app artifacts output path is missing project name #55692

Closed

Description

@iikuzmychov

Describe the bug

File-based apps produce a different artifacts output layout comparing to normal projects when <UseArtifactsOutput> is enabled.

For a regular project, the project name is included in the artifacts path: artifacts/bin/MyProject/debug/.
For a file-based app, the project name/directory is omitted: artifacts/bin/debug/.

This cause multiple file-based apps using the same ArtifactsPath to share the same output directory, which is bad from both aesthetic and practical sides.

Steps to reproduce

I created a repository for easy issue reproduction: https://github.com/iikuzmychov/dotnet-file-based-app-artifacts-path-issue-repro.

Expected behavior

For a file-based app, I would expect the artifacts path look smth like this: artifacts/bin/FileBasedApp-cs/debug.

Actual behavior

For a file-based app, the artifacts path look like this: artifacts/bin/debug/.

Is this a regression?

No response

Are there any workarounds?

No response

dotnet --info output

PS C:\Users\iikuzmychov\source\repos\dotnet-file-based-app-artifacts-path-issue> dotnet --info
.NET SDK:
 Version:           10.0.302
 Commit:            35b593bebf
 Workload version:  10.0.300-manifests.714b12c0
 MSBuild version:   18.6.11+35b593beb

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26200
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.302\

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
  Version:      11.0.0-preview.4.26230.115
  Architecture: x64
  Commit:       4370ea1634

.NET SDKs installed:
  10.0.103 [C:\Program Files\dotnet\sdk]
  10.0.201 [C:\Program Files\dotnet\sdk]
  10.0.302 [C:\Program Files\dotnet\sdk]
  11.0.100-preview.4.26230.115 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 10.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 11.0.0-preview.4.26230.115 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 11.0.0-preview.4.26230.115 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 11.0.0-preview.4.26230.115 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Invalid [C:\Users\iikuzmychov\source\repos\dotnet-file-based-app-artifacts-path-issue\global.json]
    Version '10.0.0' is not valid for the 'sdk/version' value. SDK feature bands start at 1 - for example, 10.0.100

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

IDE version

No response

Other details

No response

Activity

  1. added
    untriaged
    on Aug 9, 2026
  2. locked and limited conversation to collaborators on Aug 9, 2026
  3. unlocked this conversation on Aug 9, 2026
  4. added
    Area-run-file
    cookie
    and removed
    untriaged
    on Aug 9, 2026
  5. github-actions commented on Aug 9, 2026

    @github-actions
    Contributor

    🎯 Agentic Issue Triage

    Triage Assessment:

    • 🏷️ Labels: Area-run-file Items related to the "dotnet run <file>" effort Bug cookie Issue Monster Loves Cookies!
    • 💻 Assignment: @dsplaisted | @dotnet/dotnet-cli
    • 🟩 Confidence: high - Issue clearly describes a file-based app artifact path bug in the run-file area.

    Similar issues: #50227 (potentially related)

    ➡️ Summary: File-based apps with UseArtifactsOutput enabled produce an output path missing the project name, causing output directory collisions. Review the file-based app build targets to include the file name in the artifacts path segment.

    Generated by 🏷️ Issue Triage for #55692 · 40.6 AIC · ⌖ 3.93 AIC · ⊞ 10.1K · ◷

  6. added theissue type on Aug 10, 2026
  7. removed
    cookie
    on Aug 10, 2026
  8. jjonescz commented on Aug 10, 2026

    @jjonescz
    Member

    I had a PR for this that got stale: #49863. I will try to reopen it.

  9. jjonescz commented on Aug 11, 2026

    @jjonescz
    Member

    FYI, I think you can work around this in the meantime by setting property IncludeProjectNameInArtifactsPaths=true in Directory.Build.props (or wherever you are setting UseArtifactsOutput).

  10. iikuzmychov commented on Aug 13, 2026

    @iikuzmychov
    Author

    @jjonescz Thanks for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area-run-file

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions