File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22 <PropertyGroup >
33 <OutputType >WinExe</OutputType >
4- <TargetFramework >net5 .0</TargetFramework >
4+ <TargetFramework >net6 .0</TargetFramework >
55 <Nullable >enable</Nullable >
66 </PropertyGroup >
77 <ItemGroup >
Original file line number Diff line number Diff line change 11using System ;
2+ using System . Diagnostics ;
23using Avalonia ;
34using Avalonia . Controls . ApplicationLifetimes ;
45using Avalonia . ReactiveUI ;
@@ -12,9 +13,10 @@ class Program
1213 [ STAThread ]
1314 public static void Main ( string [ ] args )
1415 {
15-
16- BuildAvaloniaApp ( )
17- . StartWithClassicDesktopLifetime ( args ) ;
16+ var isRunningInAnotherInstance = Process . GetProcessesByName ( System . IO . Path . GetFileNameWithoutExtension ( System . Reflection . Assembly . GetEntryAssembly ( ) . Location ) ) . Length > 1 ;
17+ if ( ! isRunningInAnotherInstance )
18+ BuildAvaloniaApp ( )
19+ . StartWithClassicDesktopLifetime ( args ) ;
1820 }
1921
2022 // Avalonia configuration, don't remove; also used by visual designer.
You can’t perform that action at this time.
0 commit comments