From a1665a85254c755b339f792d1a55f77e4940ee2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Wed, 30 Oct 2024 23:07:49 -0400 Subject: [PATCH] fix: Provide only the arguments to the default ApplicationBuilder (cherry picked from commit a263cee6ef61615c5212cf04d8dc3a677116518a) --- src/Uno.Extensions.Hosting.UI/ApplicationBuilder.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Uno.Extensions.Hosting.UI/ApplicationBuilder.cs b/src/Uno.Extensions.Hosting.UI/ApplicationBuilder.cs index 6fb42a65c0..9b2f9620ea 100644 --- a/src/Uno.Extensions.Hosting.UI/ApplicationBuilder.cs +++ b/src/Uno.Extensions.Hosting.UI/ApplicationBuilder.cs @@ -19,7 +19,11 @@ internal record ApplicationBuilder(Application App, LaunchActivatedEventArgs Arg public IHost Build() { - var builder = UnoHost.CreateDefaultBuilder(ApplicationAssembly, Environment.GetCommandLineArgs()); + var builder = UnoHost.CreateDefaultBuilder( + ApplicationAssembly, + // Skip the first argument which contains the executable path that causes + // issues in the CommandLine parser. + Environment.GetCommandLineArgs().Skip(1).ToArray()); foreach (var del in _delegates) { del(builder);