File tree Expand file tree Collapse file tree 5 files changed +38
-13
lines changed
MigrationTools.ConsoleFull Expand file tree Collapse file tree 5 files changed +38
-13
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 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 {
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 },
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11using System ;
22using System . IO ;
3+ using System . Diagnostics ;
34using System . Linq ;
45using System . Reflection ;
56using 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
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments