File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Microsoft.NET.Publish.Tests
Microsoft.NET.TestFramework Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,16 @@ public void It_publishes_portable_apps_to_the_publish_folder_and_the_app_should_
7070 }
7171
7272 [ Theory ]
73+ [ InlineData ( "netcoreapp1.1" ) ]
7374 [ InlineData ( "netcoreapp2.0" ) ]
7475 [ InlineData ( ToolsetInfo . CurrentTargetFramework ) ]
7576 public void It_publishes_self_contained_apps_to_the_publish_folder_and_the_app_should_run ( string targetFramework )
7677 {
78+ if ( ! EnvironmentInfo . SupportsTargetFramework ( targetFramework ) )
79+ {
80+ return ;
81+ }
82+
7783 var rid = EnvironmentInfo . GetCompatibleRid ( targetFramework ) ;
7884
7985 var helloWorldAsset = _testAssetsManager
Original file line number Diff line number Diff line change @@ -54,7 +54,21 @@ public static string GetCompatibleRid(string targetFramework = null)
5454 // able to run on the current OS
5555 public static bool SupportsTargetFramework ( string targetFramework )
5656 {
57- var nugetFramework = NuGetFramework . Parse ( targetFramework ) ;
57+ NuGetFramework nugetFramework = null ;
58+ try
59+ {
60+ nugetFramework = NuGetFramework . Parse ( targetFramework ) ;
61+ }
62+ catch
63+ {
64+ return false ;
65+ }
66+
67+ if ( nugetFramework == null )
68+ {
69+ return false ;
70+ }
71+
5872 string currentRid = RuntimeInformation . RuntimeIdentifier ;
5973
6074 string ridOS = currentRid . Split ( '.' ) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments