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_
70
70
}
71
71
72
72
[ Theory ]
73
+ [ InlineData ( "netcoreapp1.1" ) ]
73
74
[ InlineData ( "netcoreapp2.0" ) ]
74
75
[ InlineData ( ToolsetInfo . CurrentTargetFramework ) ]
75
76
public void It_publishes_self_contained_apps_to_the_publish_folder_and_the_app_should_run ( string targetFramework )
76
77
{
78
+ if ( ! EnvironmentInfo . SupportsTargetFramework ( targetFramework ) )
79
+ {
80
+ return ;
81
+ }
82
+
77
83
var rid = EnvironmentInfo . GetCompatibleRid ( targetFramework ) ;
78
84
79
85
var helloWorldAsset = _testAssetsManager
Original file line number Diff line number Diff line change @@ -54,7 +54,21 @@ public static string GetCompatibleRid(string targetFramework = null)
54
54
// able to run on the current OS
55
55
public static bool SupportsTargetFramework ( string targetFramework )
56
56
{
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
+
58
72
string currentRid = RuntimeInformation . RuntimeIdentifier ;
59
73
60
74
string ridOS = currentRid . Split ( '.' ) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments