@@ -541,6 +541,11 @@ public void PublishingRegistersWrittenFilesForProperCleanup()
541
541
UseArtifactsOutput = true ,
542
542
} ;
543
543
544
+ var hostfxrName =
545
+ RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) ? "hostfxr.dll" :
546
+ RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) ? "libhostfxr.so" :
547
+ "libhostfxr.dylib" ;
548
+
544
549
var testAsset = _testAssetsManager . CreateTestProject ( testProject ) ;
545
550
546
551
// Now add a Directory.Build.props file setting UseArtifactsOutput to true
@@ -567,11 +572,11 @@ public void PublishingRegistersWrittenFilesForProperCleanup()
567
572
. Pass ( ) ;
568
573
569
574
var outputDir = new DirectoryInfo ( OutputPathCalculator . FromProject ( testAsset . Path , testProject ) . GetOutputDirectory ( configuration : "release" ) ) ;
570
- outputDir . Should ( ) . Exist ( ) . And . HaveFile ( "hostfxr.dll" ) ;
575
+ outputDir . Should ( ) . Exist ( ) . And . HaveFile ( hostfxrName ) ;
571
576
LocateAndRunApp ( outputDir ) ;
572
577
573
578
var publishDir = new DirectoryInfo ( OutputPathCalculator . FromProject ( testAsset . Path , testProject ) . GetPublishDirectory ( configuration : "release" ) ) ;
574
- publishDir . Should ( ) . Exist ( ) . And . HaveFile ( "hostfxr.dll" ) ;
579
+ publishDir . Should ( ) . Exist ( ) . And . HaveFile ( hostfxrName ) ;
575
580
LocateAndRunApp ( publishDir ) ;
576
581
577
582
// now build the app in Release configuration.
@@ -583,7 +588,7 @@ public void PublishingRegistersWrittenFilesForProperCleanup()
583
588
. Should ( )
584
589
. Pass ( ) ;
585
590
outputDir . Should ( ) . Exist ( ) ;
586
- outputDir . Should ( ) . NotHaveFiles ( [ "hostfxr.dll" ] ) ;
591
+ outputDir . Should ( ) . NotHaveFiles ( [ hostfxrName ] ) ;
587
592
LocateAndRunApp ( outputDir ) ;
588
593
589
594
void LocateAndRunApp ( DirectoryInfo root )
0 commit comments