<Library Name="System.Runtime.Serialization.Formatters.Tests">
<!-- This test builds a big collection of objects to serialize in a way that's hard to track as well as reflecting for Equals methods-->
<Assembly Name="Microsoft.CSharp" BinaryFormatter="All" Dynamic="Required Public" />
+ <Assembly Name="System.CodeDom" BinaryFormatter="All" Dynamic="Required Public" />
<Assembly Name="System.Collections" BinaryFormatter="All" Dynamic="Required Public" />
<Assembly Name="System.Collections.NonGeneric" BinaryFormatter="All" Dynamic="Required Public" />
<Assembly Name="System.Collections.Specialized" BinaryFormatter="All" Dynamic="Required Public" />
}
List<TypeSerializableValue> blobList = blobs.ToList();
+ int index;
// .NET Framework
if (PlatformDetection.IsFullFramework)
// Check if a specialized blob for >=netfx472 is present and return if found.
if (IsNetfx472PatchedOrNewer())
{
- int index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netfx472);
+ index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netfx472);
if (index >= 0)
return index;
// Check if a specialized blob for >=netfx471 is present and return if found.
if (PlatformDetection.IsNetfx471OrNewer)
{
- int index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netfx471);
+ index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netfx471);
if (index >= 0)
return index;
return blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netfx461);
}
- // .NET Core
- if (PlatformDetection.IsNetCore)
- {
- // Check if a specialized blob for >=netcoreapp3.0 is present and return if found.
- int index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netcoreapp30);
- if (index >= 0)
- return index;
-
- // Check if a specialized blob for netcoreapp2.1 is present and return if found.
- index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netcoreapp21);
- if (index >= 0)
- return index;
-
- // If no newer blob for >=netcoreapp2.1 is present use existing one.
- // If no netcoreapp blob is present then -1 will be returned.
- return blobList.FindIndex((b => b.Platform == TargetFrameworkMoniker.netcoreapp20));
- }
+ // Check if a specialized blob for >=netcoreapp3.0 is present and return if found.
+ index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netcoreapp30);
+ if (index >= 0)
+ return index;
+
+ // Check if a specialized blob for netcoreapp2.1 is present and return if found.
+ index = blobList.FindIndex(b => b.Platform == TargetFrameworkMoniker.netcoreapp21);
+ if (index >= 0)
+ return index;
- return -1;
+ // If no newer blob for >=netcoreapp2.1 is present use existing one.
+ // If no netcoreapp blob is present then -1 will be returned.
+ return blobList.FindIndex((b => b.Platform == TargetFrameworkMoniker.netcoreapp20));
}
}
}