Skip to content

Commit 77bb948

Browse files
committed
Enhance launch configurations and tasks for improved debugging experience and terminal management
- Simplified pre-launch task for PowerShell launch - Updated program path for migration executable - Changed terminal panel to dedicated for repeated launches - Added optional pause on exit for better visibility in external terminal - Improved error logging in VersionOptions
1 parent 8c97a0d commit 77bb948

File tree

5 files changed

+38
-13
lines changed

5 files changed

+38
-13
lines changed

.vscode/launch.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,23 @@
1616
"name": "Full execute",
1717
"type": "clr",
1818
"request": "launch",
19-
"preLaunchTask": "build full framework",
20-
"program": "${workspaceFolder}/src/MigrationTools.ConsoleFull/bin/Debug/net472/migration.exe",
19+
// Use a lightweight build to avoid long pre-launch chains that delay debugger attach
20+
"preLaunchTask": "build",
21+
// Full .NET Framework exe built for net472 – coreclr debugger can launch it.
22+
"program": "${workspaceFolder}/src/MigrationTools.ConsoleFull/bin/Debug/net472/devopsmigration.exe",
2123
"args": [
2224
"execute",
2325
"-c",
24-
"configuration.json"
26+
"configuration-default.json"
2527
],
26-
"cwd": "${workspaceFolder}/src/MigrationTools.ConsoleFull/bin/Debug/net472/",
28+
"cwd": "${workspaceFolder}/src/MigrationTools.ConsoleFull/bin/Debug/net472",
29+
// Use external terminal so it opens a new window and stays after exit (pause handled in code when env var set)
2730
"console": "externalTerminal",
28-
"stopAtEntry": false
31+
"stopAtEntry": false,
32+
"justMyCode": true,
33+
"env": {
34+
"MIGRATIONTOOLS_PAUSE_ON_EXIT": "1"
35+
}
2936
},
3037
{
3138
"name": "Attach to .NET Functions",

.vscode/tasks.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
"isDefault": true
4040
},
4141
"presentation": {
42+
// Use a single dedicated panel so repeated launches do not create many terminals
4243
"reveal": "always",
43-
"panel": "new"
44+
"panel": "dedicated"
4445
}
4546
},
4647
{
@@ -83,8 +84,9 @@
8384
"command": "${workspaceFolder}/GenerateDocs.ps1",
8485
"group": "build",
8586
"presentation": {
87+
// Share panel with prior executions instead of creating a new terminal each time
8688
"reveal": "always",
87-
"panel": "new"
89+
"panel": "dedicated"
8890
},
8991
"problemMatcher": "$msCompile"
9092
},

buildDocs.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ $msBuildExe = 'C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe'
22
& nuget restore
33
& "$($msBuildExe)" "MigrationTools.sln" /t:Build /m
44

5-
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\migration.exe" init --config ".\docs\Reference\Generated\configuration.config"
6-
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\migration.exe" init --options Full --config ".\docs\Reference\Generated\configuration-Full.config"
7-
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\migration.exe" init --options WorkItemTracking --config ".\docs\Reference\Generated\configuration-WorkItemTracking.config"
8-
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\migration.exe" init --options Fullv2 --config ".\docs\Reference\Generated\configuration-Fullv2.config"
9-
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\migration.exe" init --options WorkItemTrackingv2 --config ".\docs\Reference\Generated\configuration-WorkItemTrackingv2.config"
5+
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\devopsmigration.exe" init --config ".\docs\Reference\Generated\configuration.config"
6+
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\devopsmigration.exe" init --options Full --config ".\docs\Reference\Generated\configuration-Full.config"
7+
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\devopsmigration.exe" init --options WorkItemTracking --config ".\docs\Reference\Generated\configuration-WorkItemTracking.config"
8+
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\devopsmigration.exe" init --options Fullv2 --config ".\docs\Reference\Generated\configuration-Fullv2.config"
9+
& ".\src\MigrationTools.ConsoleFull\bin\Debug\net472\devopsmigration.exe" init --options WorkItemTrackingv2 --config ".\docs\Reference\Generated\configuration-WorkItemTrackingv2.config"
1010

1111

1212

src/MigrationTools.ConsoleFull/Program.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.IO;
3+
using System.Diagnostics;
34
using System.Linq;
45
using System.Reflection;
56
using System.Threading.Tasks;
@@ -56,6 +57,20 @@ public static async Task Main(string[] args)
5657
services.AddMigrationToolServicesForClientTfs_Processors();
5758
});
5859
await hostBuilder.RunConsoleAsync();
60+
61+
// Optional pause so an external terminal launched under the debugger stays open.
62+
try
63+
{
64+
var pauseEnv = Environment.GetEnvironmentVariable("MIGRATIONTOOLS_PAUSE_ON_EXIT");
65+
if (Debugger.IsAttached || (pauseEnv != null && (pauseEnv.Equals("1", StringComparison.OrdinalIgnoreCase) || pauseEnv.Equals("true", StringComparison.OrdinalIgnoreCase))))
66+
{
67+
Console.WriteLine();
68+
Console.WriteLine("Execution complete.");
69+
Console.Write("Press Enter to close this window...");
70+
Console.ReadLine();
71+
}
72+
}
73+
catch { /* swallow any console IO exceptions (e.g., redirected output) */ }
5974
}
6075
}
6176

src/MigrationTools/Options/VersionOptions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,9 @@ private static JSchema LoadConfigurationSchema()
240240
// For now, return null to indicate schema couldn't be loaded
241241
return null;
242242
}
243-
catch
243+
catch (Exception ex)
244244
{
245+
Log.Error(ex.ToString());
245246
return null;
246247
}
247248
}

0 commit comments

Comments
 (0)