This commit is contained in:
Jérôme Laban 2024-09-11 23:44:04 -04:00 коммит произвёл GitHub
Родитель ec24144cf6
Коммит 1213ecce62
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -34,8 +34,13 @@ internal class WpfHostBuilder : IPlatformHostBuilder, IWindowsSkiaHostBuilder
// ASP.NET Core Runtime 9.0.0-preview.4.24267.6
//.NET Desktop Runtime 9.0.0-preview.4.24267.11
// This is a quite hacky to get to the right path where we don't exactly know the version beforehand.
var indexOfPreview = runtimeVersion.IndexOf("-preview", StringComparison.Ordinal)
|| runtimeVersion.IndexOf("-rc", StringComparison.Ordinal);
var indexOfPreview = runtimeVersion.IndexOf("-preview", StringComparison.Ordinal);
if(indexOfPreview == -1)
{
indexOfPreview = runtimeVersion.IndexOf("-rc", StringComparison.Ordinal);
}
if (indexOfPreview > -1)
{
var mainVersion = runtimeVersion.Substring(0, indexOfPreview);
@ -45,7 +50,7 @@ internal class WpfHostBuilder : IPlatformHostBuilder, IWindowsSkiaHostBuilder
var possibleVersion = Path.GetFileName(directory);
var possibleIndexOfPreview = possibleVersion?.IndexOf("-preview", StringComparison.Ordinal) ?? -1;
if(possibleIndexOfPreview > -1)
if(possibleIndexOfPreview == -1)
{
possibleIndexOfPreview = possibleVersion?.IndexOf("-rc", StringComparison.Ordinal) ?? -1;
}