Skip to content

Commit eba440e

Browse files
authored
revert part of #29916 (#29966)
1 parent 2c3408b commit eba440e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAHelloWorldProject.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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

src/Tests/Microsoft.NET.TestFramework/EnvironmentInfo.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff 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];

0 commit comments

Comments
 (0)