microsoft / winget-create

The Windows Package Manager Manifest Creator command-line tool (aka wingetcreate)
MIT License
489 stars 84 forks source link

An issue when creating the manifest after downloading exe and portable #382

Closed BrandonWanHuanSheng closed 1 year ago

BrandonWanHuanSheng commented 1 year ago

Brief description of your issue

When I run wingetcreate new, creating a new manifest for yt-dlp.yt-dlp.nighty,. Specifying 4 URL at the same times. It look like wingetcreate throw this error.

Steps to reproduce

wingetcreate new "https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/download/2023.06.04.142854/yt-dlp.exe" "https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/download/2023.06.04.142854/yt-dlp_x86.exe" "https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/download/2023.06.04.142854/yt-dlp_win.zip" "https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/download/2023.06.04.142854/yt-dlp_win.zip" Typing the app information.

Expected behavior

Expected to be manifest validation succeed.

Actual behavior

It throw this error out while creating the manifest and after downloading the 4 URL.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Object of type 'System.Linq.Enumerable+SelectListIterator2[System.String,System.String]' cannot be converted to type 'System.Collections.Generic.List1[System.String]'. at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast) at System.Reflection.MethodBase.CheckArguments(StackAllocedArguments& stackArgs, ReadOnlySpan1 parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) at System.Reflection.RuntimeMethodInfo.InvokeOneParameter(Object obj, BindingFlags invokeAttr, Binder binder, Object parameter, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index) at Microsoft.WingetCreateCLI.PromptHelper.PromptList[T](String message, Object model, String memberName, IEnumerable1 instance, Int32 minimum, Object validationModel, String validationName) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Microsoft.WingetCreateCLI.PromptHelper.PromptPropertyAndSetValue[T](Object model, String memberName, T instance, Int32 minimum, Object validationModel, String validationName) at Microsoft.WingetCreateCLI.Commands.NewCommand.PromptOptionalProperties[T](T manifest) at Microsoft.WingetCreateCLI.Commands.NewCommand.PromptPropertiesAndDisplayManifests(Manifests manifests) at Microsoft.WingetCreateCLI.Commands.NewCommand.Execute() at Microsoft.WingetCreateCLI.Program.Main(String[] args)

Log: WingetCreateLog-2023-06-05-22-43.199.txt

Environment

wingetcreate
Windows Package Manager Manifest Creator v1.2.6.0

winget --info
Windows Package Manager v1.4.10173
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.3030
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
BrandonWanHuanSheng commented 1 year ago

WingetCreateLog-2023-06-06-17-30.097.txt Screenshot (248) Screenshot (249)

ryfu-msft commented 1 year ago

@BrandonWanHuanSheng, this issue has been resolved by #390 and the fix is now available in our latest release v1.2.7.0.