Add dev/debug startup flow and launch profiles

Handle design-time initialization and add a developer debug startup path: App now skips normal startup when in design mode and shows a DevDebugWindow when running in debug (unless a preview or apply-update command). CommandContext.IsDebugMode is extended to include DOTNET_ENVIRONMENT=Development via a new IsDevelopmentEnvironment helper. Program.Main and BuildAvaloniaApp are made public to aid tooling. Added multiple launchSettings profiles for debug and preview commands that set DOTNET_ENVIRONMENT=Development to simplify IDE debugging and UI previewing.
This commit is contained in:
lincube
2026-04-24 17:25:53 +08:00
parent ad3648a0b8
commit 403cf280bb
4 changed files with 91 additions and 5 deletions

View File

@@ -4,10 +4,10 @@ using LanMountainDesktop.Launcher.Services;
namespace LanMountainDesktop.Launcher;
internal static class Program
public static class Program
{
[STAThread]
private static async Task<int> Main(string[] args)
public static async Task<int> Main(string[] args)
{
var commandContext = CommandContext.FromArgs(args);
var execution = LauncherExecutionContext.Capture();
@@ -66,7 +66,7 @@ internal static class Program
}
}
private static AppBuilder BuildAvaloniaApp()
public static AppBuilder BuildAvaloniaApp()
{
return AppBuilder.Configure<App>()
.UsePlatformDetect()