diff --git a/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Utilities/ProjectFileExtensions.cs b/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Utilities/ProjectFileExtensions.cs index eec4bac4fe74..ef35445eee4a 100644 --- a/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Utilities/ProjectFileExtensions.cs +++ b/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Utilities/ProjectFileExtensions.cs @@ -236,11 +236,7 @@ public static void SetTopLevelPropertyGroupValue (this XmlDocument csproj, strin public static void RemoveTargetFrameworkIdentifier (this XmlDocument csproj) { - try { - RemoveNode (csproj, "TargetFrameworkIdentifier"); - } catch { - // ignore exceptions, if not present, we are not worried - } + RemoveNode (csproj, "TargetFrameworkIdentifier", throwOnInexistentNode: false); } public static void SetAssemblyName (this XmlDocument csproj, string value)