Browse Source

make GetNetCoreVersion work with preview

af/UniformUnmanagedMemoryPoolMemoryAllocator-02-MemoryGuards
Anton Firszov 5 years ago
parent
commit
8dda1d5d31
  1. 9
      tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

9
tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

@ -269,7 +269,14 @@ namespace SixLabors.ImageSharp.Tests
int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App"); int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App");
if (netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath.Length - 2) if (netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath.Length - 2)
{ {
return Version.Parse(assemblyPath[netCoreAppIndex + 1]); string runtimeFolderStr = assemblyPath[netCoreAppIndex + 1];
int previewSuffix = runtimeFolderStr.IndexOf('-');
if (previewSuffix > 0)
{
runtimeFolderStr = runtimeFolderStr.Substring(0, previewSuffix);
}
return Version.Parse(runtimeFolderStr);
} }
return null; return null;

Loading…
Cancel
Save