From b4e74e972d717e42073369960800b1645547f36d Mon Sep 17 00:00:00 2001 From: Travis Illig Date: Tue, 1 Sep 2026 10:26:21 -0700 Subject: [PATCH] Repair the VS Code launch configurations Two of the seven configurations named AspNetCore3Example and AspNetCore3ChildLifetimeScope, projects deleted some time ago, and the rest pointed at bin/Debug/net6.0 or netcoreapp3.1 paths for projects that target net10.0. Nothing in the file could start. AspNetCoreChildLifetimeScope and AspNetCoreNoStartupExample had no configuration at all despite being runnable. Environment variables now come from each project's launchSettings.json via launchSettingsProfile rather than an inline env block, so there is one place to change them instead of two that can disagree. The ASP.NET Core profiles use DOTNET_ENVIRONMENT; the .NET Framework ones are left alone because classic ASP.NET reads neither prefix and their entries are inert VS boilerplate. Also drops a sourceFileMap pointing at a Views folder that does not exist at the workspace root, the omnisharp settings the Roslyn language server ignores, and a test explorer recommendation for a repo with no tests. Adds dotnet.defaultSolution so the C# extension stops asking which solution to load. Part of #32 --- .vscode/extensions.json | 1 - .vscode/launch.json | 51 +++++++------------ .vscode/settings.json | 3 +- .../Properties/launchSettings.json | 2 +- .../Properties/launchSettings.json | 2 +- .../Properties/launchSettings.json | 2 +- 6 files changed, 22 insertions(+), 39 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 767b23a..abf61a6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,5 @@ { "recommendations": [ - "formulahendry.dotnet-test-explorer", "ms-dotnettools.csharp", "editorconfig.editorconfig", "davidanson.vscode-markdownlint" diff --git a/.vscode/launch.json b/.vscode/launch.json index a059b5f..f1f259a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,62 +1,47 @@ { "configurations": [ { - "cwd": "${workspaceFolder}/src/AspNetCore3Example", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "name": "AspNetCore3Example", + "cwd": "${workspaceFolder}/src/AspNetCoreChildLifetimeScope", + "launchSettingsProfile": "AspNetCoreChildLifetimeScope", + "name": "AspNetCoreChildLifetimeScope", "preLaunchTask": "build", - "program": "${workspaceFolder}/src/AspNetCore3Example/bin/Debug/netcoreapp3.1/AspNetCore3Example.dll", + "program": "${workspaceFolder}/src/AspNetCoreChildLifetimeScope/bin/Debug/net10.0/AspNetCoreChildLifetimeScope.dll", "request": "launch", "serverReadyAction": { "action": "openExternally", "pattern": "\\bNow listening on:\\s+(https?://\\S+)", - "uriFormat": "%s/api/Values" - }, - "sourceFileMap": { - "/Views": "${workspaceFolder}/Views" + "uriFormat": "%s/api/ApplicationA" }, "stopAtEntry": false, "type": "coreclr" }, { - "cwd": "${workspaceFolder}/src/AspNetCore3ChildLifetimeScope", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "name": "AspNetCore3ChildLifetimeScope", + "cwd": "${workspaceFolder}/src/AspNetCoreExample", + "launchSettingsProfile": "AspNetCoreExample", + "name": "AspNetCoreExample", "preLaunchTask": "build", - "program": "${workspaceFolder}/src/AspNetCore3ChildLifetimeScope/bin/Debug/netcoreapp3.1/AspNetCore3ChildLifetimeScope.dll", + "program": "${workspaceFolder}/src/AspNetCoreExample/bin/Debug/net10.0/AspNetCoreExample.dll", "request": "launch", "serverReadyAction": { "action": "openExternally", "pattern": "\\bNow listening on:\\s+(https?://\\S+)", - "uriFormat": "%s/api/ApplicationA" - }, - "sourceFileMap": { - "/Views": "${workspaceFolder}/Views" + "uriFormat": "%s/api/Values" }, "stopAtEntry": false, "type": "coreclr" }, { - "cwd": "${workspaceFolder}/src/AspNetCoreExample", - "env": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "name": "AspNetCoreExample", + "cwd": "${workspaceFolder}/src/AspNetCoreNoStartupExample", + "launchSettingsProfile": "AspNetCoreNoStartupExample", + "name": "AspNetCoreNoStartupExample", "preLaunchTask": "build", - "program": "${workspaceFolder}/src/AspNetCoreExample/bin/Debug/net6.0/AspNetCoreExample.dll", + "program": "${workspaceFolder}/src/AspNetCoreNoStartupExample/bin/Debug/net10.0/AspNetCoreNoStartupExample.dll", "request": "launch", "serverReadyAction": { "action": "openExternally", "pattern": "\\bNow listening on:\\s+(https?://\\S+)", "uriFormat": "%s/api/Values" }, - "sourceFileMap": { - "/Views": "${workspaceFolder}/Views" - }, "stopAtEntry": false, "type": "coreclr" }, @@ -65,7 +50,7 @@ "cwd": "${workspaceFolder}/src/AttributeMetadataExample", "name": "AttributeMetadataExample", "preLaunchTask": "build", - "program": "${workspaceFolder}/src/AttributeMetadataExample/bin/Debug/net6.0/AttributeMetadataExample.dll", + "program": "${workspaceFolder}/src/AttributeMetadataExample/bin/Debug/net10.0/AttributeMetadataExample.dll", "request": "launch", "stopAtEntry": false, "type": "coreclr" @@ -75,7 +60,7 @@ "cwd": "${workspaceFolder}/src/ConfigurationExample", "name": "ConfigurationExample", "preLaunchTask": "build", - "program": "${workspaceFolder}/src/ConfigurationExample/bin/Debug/net6.0/ConfigurationExample.dll", + "program": "${workspaceFolder}/src/ConfigurationExample/bin/Debug/net10.0/ConfigurationExample.dll", "request": "launch", "stopAtEntry": false, "type": "coreclr" @@ -85,7 +70,7 @@ "cwd": "${workspaceFolder}/src/GenericHostBuilderExample", "name": "GenericHostBuilderExample", "preLaunchTask": "build", - "program": "${workspaceFolder}/src/GenericHostBuilderExample/bin/Debug/net6.0/GenericHostBuilderExample.dll", + "program": "${workspaceFolder}/src/GenericHostBuilderExample/bin/Debug/net10.0/GenericHostBuilderExample.dll", "request": "launch", "stopAtEntry": false, "type": "coreclr" @@ -95,7 +80,7 @@ "cwd": "${workspaceFolder}/src/MultitenantExample.ConsoleApplication", "name": "MultitenantExample.ConsoleApplication", "preLaunchTask": "build", - "program": "${workspaceFolder}/src/MultitenantExample.ConsoleApplication/bin/Debug/net6.0/MultitenantExample.ConsoleApplication.dll", + "program": "${workspaceFolder}/src/MultitenantExample.ConsoleApplication/bin/Debug/net10.0/MultitenantExample.ConsoleApplication.dll", "request": "launch", "stopAtEntry": false, "type": "coreclr" diff --git a/.vscode/settings.json b/.vscode/settings.json index 1528ec1..0a38f1c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,6 +8,5 @@ "multitenant", "unconfigured" ], - "omnisharp.enableEditorConfigSupport": true, - "omnisharp.enableRoslynAnalyzers": true + "dotnet.defaultSolution": "Examples.slnx" } diff --git a/src/AspNetCoreChildLifetimeScope/Properties/launchSettings.json b/src/AspNetCoreChildLifetimeScope/Properties/launchSettings.json index 8bdc88f..4022a2f 100644 --- a/src/AspNetCoreChildLifetimeScope/Properties/launchSettings.json +++ b/src/AspNetCoreChildLifetimeScope/Properties/launchSettings.json @@ -3,7 +3,7 @@ "AspNetCoreChildLifetimeScope": { "commandName": "Project", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "DOTNET_ENVIRONMENT": "Development" }, "launchBrowser": false } diff --git a/src/AspNetCoreExample/Properties/launchSettings.json b/src/AspNetCoreExample/Properties/launchSettings.json index 2f633c7..f805c3a 100644 --- a/src/AspNetCoreExample/Properties/launchSettings.json +++ b/src/AspNetCoreExample/Properties/launchSettings.json @@ -3,7 +3,7 @@ "AspNetCoreExample": { "commandName": "Project", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "DOTNET_ENVIRONMENT": "Development" }, "launchBrowser": true, "launchUrl": "http://localhost:5000/api/values" diff --git a/src/AspNetCoreNoStartupExample/Properties/launchSettings.json b/src/AspNetCoreNoStartupExample/Properties/launchSettings.json index a0a02e7..8d528de 100644 --- a/src/AspNetCoreNoStartupExample/Properties/launchSettings.json +++ b/src/AspNetCoreNoStartupExample/Properties/launchSettings.json @@ -3,7 +3,7 @@ "AspNetCoreNoStartupExample": { "commandName": "Project", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "DOTNET_ENVIRONMENT": "Development" }, "launchBrowser": true, "launchUrl": "http://localhost:5000/api/values"