@@ -389,6 +389,16 @@ protected Assembly GetEntryAssembly()
389
389
// Design time
390
390
if ( asm == null )
391
391
{
392
+ #if NET50
393
+ asm = (
394
+ from assembly in AppDomain . CurrentDomain . GetAssemblies ( )
395
+ where ! assembly . IsDynamic
396
+ let assmName = Path . GetFileName ( assembly . Location ) . Trim ( )
397
+ where assmName . EndsWith ( ".exe" , comparer )
398
+ where ! string . Equals ( assmName , "XDesProc.exe" , comparer ) // should not be XDesProc.exe
399
+ select assembly
400
+ ) . FirstOrDefault ( ) ;
401
+ #else
392
402
asm = (
393
403
from assembly in AppDomain . CurrentDomain . GetAssemblies ( )
394
404
where ! assembly . IsDynamic
@@ -397,6 +407,7 @@ where assmName.EndsWith(".exe", comparer)
397
407
where ! string . Equals ( assmName , "XDesProc.exe" , comparer ) // should not be XDesProc.exe
398
408
select assembly
399
409
) . FirstOrDefault ( ) ;
410
+ #endif
400
411
401
412
if ( asm == null )
402
413
{
@@ -416,6 +427,16 @@ select assembly
416
427
{
417
428
if ( asm == null )
418
429
{
430
+ #if NET50
431
+ asm = (
432
+ from assembly in AppDomain . CurrentDomain . GetAssemblies ( )
433
+ where ! assembly . IsDynamic
434
+ let assmName = Path . GetFileName ( assembly . Location ) . Trim ( )
435
+ where assmName . EndsWith ( ".exe" , comparer )
436
+ where ! string . Equals ( assmName , "XDesProc.exe" , comparer ) // should not be XDesProc.exe
437
+ select assembly
438
+ ) . FirstOrDefault ( ) ;
439
+ #else
419
440
asm = (
420
441
from assembly in AppDomain . CurrentDomain . GetAssemblies ( )
421
442
where ! assembly . IsDynamic
@@ -424,6 +445,7 @@ where assmName.EndsWith(".exe", comparer)
424
445
where ! string . Equals ( assmName , "XDesProc.exe" , comparer ) // should not be XDesProc.exe
425
446
select assembly
426
447
) . FirstOrDefault ( ) ;
448
+ #endif
427
449
}
428
450
429
451
Trace . TraceError ( ex . ToString ( ) ) ;
0 commit comments