GetInstalledPackages throws exception if no packages.
MrHinsh opened this issue · comments
Martin Hinshelwood nkdAgility.com commented
Why does packageManager.GetInstalledPackages(PackageId)
throw an exception when no packages are returned rather than null
?
WGetNET.WinGetActionFailedException: The search of installed packages failed.
---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at WGetNET.HelperClasses.ProcessOutputReader.ToPackageList(String[] output, PackageAction action, String sourceName)
at WGetNET.WinGetPackageManager.GetInstalledPackages(String packageName)
--- End of inner exception stack trace ---
at WGetNET.WinGetPackageManager.GetInstalledPackages(String packageName)
at MigrationTools.Host.Services.DetectVersionService2.InitialiseService() in C:\Users\MartinHinshelwood(He\Source\repos\azure-devops-migration-tools\src\MigrationTools.Host\Services\DetectVersionService2.cs:line 70
Is there another way to check this?
Bjarne commented
This seems to be a bug. Normally it should return an empty list.
Bjarne commented
I fixed the problem.
I will inform you and close the issue when the version with the fix is released.
Bjarne commented
Version 3.1.0 is out now with a fix for this issue.