Skip to content

File-Based App Conversion Incorrectly Includes JSON Files from Other Apps #51769

@nitish-kaushik

Description

@nitish-kaushik

Describe the bug

When using dotnet project convert command on a console app file, the CLI is incorrectly including JSON files from other file-based apps in the same directory.
i am using DotNet 10 and VS Code

Workspace Structure Before Conversion

File Based Apps/
├── MyConsoleApp.cs           (Console app)
├── MyWebApp.cs               (Web app)
├── MyWebApp.run.json         (Config for MyWebApp)
├── MyWebApp.settings.json    (Config for MyWebApp)

Command Executed

dotnet project convert .\MyConsoleApp.cs

Expected Behavior

The conversion should only create a project folder for MyConsoleApp.cs without including any JSON configuration files, or should only include JSON files that are specifically named for MyConsoleApp (e.g., MyConsoleApp.run.json, MyConsoleApp.settings.json).

Actual Behavior

The CLI created the following structure:

MyConsoleApp/
├── MyConsoleApp.cs
├── MyConsoleApp.csproj
├── MyWebApp.run.json          ❌ Should NOT be included
└── MyWebApp.settings.json     ❌ Should NOT be included

The MyWebApp.run.json and MyWebApp.settings.json files were incorrectly copied into the MyConsoleApp folder, even though they are configuration files for the separate MyWebApp.cs web application.

To Reproduce

Exceptions (if any)

Further technical details

details of dotnet --info

.NET SDK: Version: 10.0.100 Commit: b0f34d51fc Workload version: 10.0.100-manifests.355811b7 MSBuild version: 18.0.2+b0f34d51f

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.100\

  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
  • VS Code
Version: 1.106.0 (user setup)
Commit: ac4cbdf48759c7d8c3eb91ffe6bb04316e263c57
Date: 2025-11-11T16:02:25.943Z
Electron: 37.7.0
ElectronBuildId: 12597478
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions