From 9673c48763ed6219c3fecfde13fdd053966d9e55 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Wed, 11 Mar 2026 17:55:44 -0700 Subject: [PATCH 1/6] Add setting for file-based apps auto discovery --- package.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package.json b/package.json index b0b3c541e..1b8f1e3a6 100644 --- a/package.json +++ b/package.json @@ -1559,6 +1559,14 @@ "tags": [ "preview" ] + }, + "dotnet.projects.enableFileBasedProgramsAutomaticDiscovery": { + "type": "boolean", + "default": true, + "description": "%configuration.dotnet.projects.enableFileBasedProgramsAutomaticDiscovery%", + "tags": [ + "preview" + ] } } }, From 5fbb0fd5c45dfea05d113bb84cc454fe7ff69641 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Tue, 24 Mar 2026 16:11:28 -0700 Subject: [PATCH 2/6] rename setting --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1b8f1e3a6..fd3519da7 100644 --- a/package.json +++ b/package.json @@ -1560,10 +1560,10 @@ "preview" ] }, - "dotnet.projects.enableFileBasedProgramsAutomaticDiscovery": { + "dotnet.fileBasedApps.enableAutomaticDiscovery": { "type": "boolean", "default": true, - "description": "%configuration.dotnet.projects.enableFileBasedProgramsAutomaticDiscovery%", + "description": "%configuration.dotnet.fileBasedApps.AutomaticDiscovery%", "tags": [ "preview" ] From 0880853fb6030d75b350a64015b63d65d557350c Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Fri, 3 Apr 2026 13:45:50 -0700 Subject: [PATCH 3/6] fix --- package.json | 2 +- package.nls.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fd3519da7..c85e1d509 100644 --- a/package.json +++ b/package.json @@ -1563,7 +1563,7 @@ "dotnet.fileBasedApps.enableAutomaticDiscovery": { "type": "boolean", "default": true, - "description": "%configuration.dotnet.fileBasedApps.AutomaticDiscovery%", + "description": "%configuration.dotnet.fileBasedApps.enableAutomaticDiscovery%", "tags": [ "preview" ] diff --git a/package.nls.json b/package.nls.json index 5828561c9..2cf46a42d 100644 --- a/package.nls.json +++ b/package.nls.json @@ -49,6 +49,7 @@ "configuration.dotnet.projects.enableAutomaticRestore": "Enables automatic NuGet restore if the extension detects assets are missing.", "configuration.dotnet.projects.enableFileBasedPrograms": "Enables the \"file-based programs\" (dotnet run app.cs) experience.", "configuration.dotnet.projects.enableFileBasedProgramsWhenAmbiguous": "Enables the \"file-based programs\" (dotnet run app.cs) experience in files where the editor is unable to determine with certainty whether the file is a file-based program. Only respected when `dotnet.projects.enableFileBasedPrograms` is `true`.", + "configuration.dotnet.fileBasedApps.enableAutomaticDiscovery": "Enables automatic discovery of C# file-based apps in the workspace.", "configuration.dotnet.projects.binaryLogPath": "Sets a path where MSBuild binary logs are written to when loading projects, to help diagnose loading errors.", "configuration.dotnet.server.sourceGeneratorExecution": "Controls when source generators are executed. (Requires extension restart)", "configuration.dotnet.server.sourceGeneratorExecution.balanced": "Source generators are executed after an explicit user action, including save, build, or the [Rerun source generators](command:csharp.rerunSourceGenerators) command.", From 64c36f6701300b780785c923c899ec8d02d564cb Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Fri, 3 Apr 2026 14:03:32 -0700 Subject: [PATCH 4/6] Migrate dotnet.projects.enableFileBasedPrograms to dotnet.fileBasedApps.enable --- package.json | 9 +++++++++ package.nls.json | 4 +++- src/shared/migrateOptions.ts | 4 ++++ .../.vscode/devkit_slnWithCsproj.code-workspace | 2 +- .../slnWithCsproj/.vscode/slnWithCsproj.code-workspace | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c85e1d509..2ce3d6df3 100644 --- a/package.json +++ b/package.json @@ -1548,6 +1548,7 @@ "type": "boolean", "default": true, "description": "%configuration.dotnet.projects.enableFileBasedPrograms%", + "deprecationMessage": "%configuration.dotnet.projects.enableFileBasedPrograms.deprecationMessage%", "tags": [ "preview" ] @@ -1560,6 +1561,14 @@ "preview" ] }, + "dotnet.fileBasedApps.enable": { + "type": "boolean", + "default": true, + "description": "%configuration.dotnet.fileBasedApps.enable%", + "tags": [ + "preview" + ] + }, "dotnet.fileBasedApps.enableAutomaticDiscovery": { "type": "boolean", "default": true, diff --git a/package.nls.json b/package.nls.json index 2cf46a42d..07bc02165 100644 --- a/package.nls.json +++ b/package.nls.json @@ -48,7 +48,9 @@ "configuration.dotnet.enableXamlTools": "Enables XAML tools when using C# Dev Kit. (Requires extension restart)", "configuration.dotnet.projects.enableAutomaticRestore": "Enables automatic NuGet restore if the extension detects assets are missing.", "configuration.dotnet.projects.enableFileBasedPrograms": "Enables the \"file-based programs\" (dotnet run app.cs) experience.", - "configuration.dotnet.projects.enableFileBasedProgramsWhenAmbiguous": "Enables the \"file-based programs\" (dotnet run app.cs) experience in files where the editor is unable to determine with certainty whether the file is a file-based program. Only respected when `dotnet.projects.enableFileBasedPrograms` is `true`.", + "configuration.dotnet.projects.enableFileBasedPrograms.deprecationMessage": "The setting 'dotnet.projects.enableFileBasedPrograms' has been deprecated in favor of 'dotnet.fileBasedApps.enable'.", + "configuration.dotnet.projects.enableFileBasedProgramsWhenAmbiguous": "Enables the \"file-based programs\" (dotnet run app.cs) experience in files where the editor is unable to determine with certainty whether the file is a file-based program. Only respected when `dotnet.fileBasedApps.enable` is `true`.", + "configuration.dotnet.fileBasedApps.enable": "Enables the \"file-based apps\" (dotnet run app.cs) experience.", "configuration.dotnet.fileBasedApps.enableAutomaticDiscovery": "Enables automatic discovery of C# file-based apps in the workspace.", "configuration.dotnet.projects.binaryLogPath": "Sets a path where MSBuild binary logs are written to when loading projects, to help diagnose loading errors.", "configuration.dotnet.server.sourceGeneratorExecution": "Controls when source generators are executed. (Requires extension restart)", diff --git a/src/shared/migrateOptions.ts b/src/shared/migrateOptions.ts index 7ddc0cb9a..d7a7bf2c2 100644 --- a/src/shared/migrateOptions.ts +++ b/src/shared/migrateOptions.ts @@ -104,6 +104,10 @@ export const migrateOptions = [ oldName: 'omnisharp.organizeImportsOnFormat', newName: 'dotnet.formatting.organizeImportsOnFormat', }, + { + oldName: 'dotnet.projects.enableFileBasedPrograms', + newName: 'dotnet.fileBasedApps.enable', + }, ]; export async function MigrateOptions(vscode: vscode): Promise { diff --git a/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace b/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace index 7b5596c70..432d79e5c 100644 --- a/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace +++ b/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace @@ -8,6 +8,6 @@ "dotnet.defaultSolution": "b_SecondInOrder_SlnFile.sln", "dotnet.server.useOmnisharp": false, "dotnet.preferCSharpExtension": false, - "dotnet.projects.enableFileBasedPrograms": true + "dotnet.fileBasedApps.enable": true } } \ No newline at end of file diff --git a/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace b/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace index c978a74c1..869d4bce9 100644 --- a/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace +++ b/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace @@ -8,6 +8,6 @@ "dotnet.defaultSolution": "b_SecondInOrder_SlnFile.sln", "dotnet.server.useOmnisharp": false, "dotnet.preferCSharpExtension": true, - "dotnet.projects.enableFileBasedPrograms": true + "dotnet.fileBasedApps.enable": true } } \ No newline at end of file From 3c7581450b5bd99741fd4b27a419bb63c942c8b7 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Fri, 3 Apr 2026 14:08:22 -0700 Subject: [PATCH 5/6] Remove setting `dotnet.projects.enableFileBasedProgramsWhenAmbiguous` --- package.json | 8 -------- package.nls.json | 1 - 2 files changed, 9 deletions(-) diff --git a/package.json b/package.json index 2ce3d6df3..c9c77cd5e 100644 --- a/package.json +++ b/package.json @@ -1553,14 +1553,6 @@ "preview" ] }, - "dotnet.projects.enableFileBasedProgramsWhenAmbiguous": { - "type": "boolean", - "default": true, - "description": "%configuration.dotnet.projects.enableFileBasedProgramsWhenAmbiguous%", - "tags": [ - "preview" - ] - }, "dotnet.fileBasedApps.enable": { "type": "boolean", "default": true, diff --git a/package.nls.json b/package.nls.json index 07bc02165..71c0b46d9 100644 --- a/package.nls.json +++ b/package.nls.json @@ -49,7 +49,6 @@ "configuration.dotnet.projects.enableAutomaticRestore": "Enables automatic NuGet restore if the extension detects assets are missing.", "configuration.dotnet.projects.enableFileBasedPrograms": "Enables the \"file-based programs\" (dotnet run app.cs) experience.", "configuration.dotnet.projects.enableFileBasedPrograms.deprecationMessage": "The setting 'dotnet.projects.enableFileBasedPrograms' has been deprecated in favor of 'dotnet.fileBasedApps.enable'.", - "configuration.dotnet.projects.enableFileBasedProgramsWhenAmbiguous": "Enables the \"file-based programs\" (dotnet run app.cs) experience in files where the editor is unable to determine with certainty whether the file is a file-based program. Only respected when `dotnet.fileBasedApps.enable` is `true`.", "configuration.dotnet.fileBasedApps.enable": "Enables the \"file-based apps\" (dotnet run app.cs) experience.", "configuration.dotnet.fileBasedApps.enableAutomaticDiscovery": "Enables automatic discovery of C# file-based apps in the workspace.", "configuration.dotnet.projects.binaryLogPath": "Sets a path where MSBuild binary logs are written to when loading projects, to help diagnose loading errors.", From 8b9563686f72268da82b1f9c75ba28c1d6850ca7 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Fri, 3 Apr 2026 14:09:46 -0700 Subject: [PATCH 6/6] remove preview tag --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index c9c77cd5e..1273717f4 100644 --- a/package.json +++ b/package.json @@ -1556,10 +1556,7 @@ "dotnet.fileBasedApps.enable": { "type": "boolean", "default": true, - "description": "%configuration.dotnet.fileBasedApps.enable%", - "tags": [ - "preview" - ] + "description": "%configuration.dotnet.fileBasedApps.enable%" }, "dotnet.fileBasedApps.enableAutomaticDiscovery": { "type": "boolean",