Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unhandled exception: System.InvalidOperationException: Sequence contains no elements #27

Closed
2 tasks done
BurgerhoutJ opened this issue Jan 8, 2024 · 1 comment · Fixed by #29
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@BurgerhoutJ
Copy link

Command

publish

Full command

winget-intune publish Garmin.BaseCamp --package-folder C:\PackagesWinTuner --username --auto-package

App version

0.7.0+Branch.main.Sha.6f15dab446ea9f234d069287d6ca0c3eadbc54be.6f15dab446ea9f234d069287d6ca0c3eadbc54be

What happened?

Throws an error. See screenshot.
image

Command output

PS C:\Users\jeroe> winget-intune publish Garmin.BaseCamp --package-folder C:\PackagesWinTuner --username --auto-package
info: WingetIntune.Commands.PackageCommand[0] Try loading latest version from package index
info: WingetIntune.Implementations.WingetManager[5] Getting package info for Garmin.BaseCamp 4.7.5.0 from github
info: WingetIntune.Commands.PackageCommand[0] Publishing package Garmin.BaseCamp 4.7.5.0
fail: WingetIntune.IntuneManager[0] Error publishing app, deleting the remains System.InvalidOperationException: Sequence contains no elements    at System.Linq.ThrowHelper.ThrowNoElementsException()    at System.Linq.Enumerable.Aggregate[TSource](IEnumerable`1 source, Func`3 func)    at Microsoft.Kiota.Serialization.Json.JsonSerializationWriter.WriteEnumValue[T](String key, Nullable`1 value)    at Microsoft.Graph.Beta.Models.Win32LobApp.Serialize(ISerializationWriter writer)    at Microsoft.Kiota.Serialization.Json.JsonSerializationWriter.WriteObjectValue[T](String key, T value, IParsable[] additionalValuesToMerge)    at Microsoft.Kiota.Abstractions.RequestInformation.SetContentFromParsable[T](IRequestAdapter requestAdapter, String contentType, T item)    at Microsoft.Graph.Beta.DeviceAppManagement.MobileApps.MobileAppsRequestBuilder.ToPostRequestInformation(MobileApp body, Action`1 requestConfiguration)    at Microsoft.Graph.Beta.DeviceAppManagement.MobileApps.MobileAppsRequestBuilder.PostAsync(MobileApp body, Action`1 requestConfiguration, CancellationToken cancellationToken)    at WingetIntune.Graph.MobileAppsRequestBuilderExtensions.PostAsync(MobileAppsRequestBuilder builder, Win32LobApp win32LobApp, CancellationToken cancellationToken) in /home/runner/work/WingetIntune/WingetIntune/src/WingetIntune/Graph/MobileAppsRequestBuilderExtensions.cs:line 15    at WingetIntune.IntuneManager.PublishAppAsync(String packagesFolder, PackageInfo packageInfo, IntunePublishOptions options, CancellationToken cancellationToken) in /home/runner/work/WingetIntune/WingetIntune/src/WingetIntune/Intune/IntuneManager.cs:line 213
Unhandled exception: System.InvalidOperationException: Sequence contains no elements
   at System.Linq.ThrowHelper.ThrowNoElementsException()
   at System.Linq.Enumerable.Aggregate[TSource](IEnumerable`1 source, Func`3 func)
   at Microsoft.Kiota.Serialization.Json.JsonSerializationWriter.WriteEnumValue[T](String key, Nullable`1 value)
   at Microsoft.Graph.Beta.Models.Win32LobApp.Serialize(ISerializationWriter writer)
   at Microsoft.Kiota.Serialization.Json.JsonSerializationWriter.WriteObjectValue[T](String key, T value, IParsable[] additionalValuesToMerge)
   at Microsoft.Kiota.Abstractions.RequestInformation.SetContentFromParsable[T](IRequestAdapter requestAdapter, String contentType, T item)
   at Microsoft.Graph.Beta.DeviceAppManagement.MobileApps.MobileAppsRequestBuilder.ToPostRequestInformation(MobileApp body, Action`1 requestConfiguration)
   at Microsoft.Graph.Beta.DeviceAppManagement.MobileApps.MobileAppsRequestBuilder.PostAsync(MobileApp body, Action`1 requestConfiguration, CancellationToken cancellationToken)
   at WingetIntune.Graph.MobileAppsRequestBuilderExtensions.PostAsync(MobileAppsRequestBuilder builder, Win32LobApp win32LobApp, CancellationToken cancellationToken) in /home/runner/work/WingetIntune/WingetIntune/src/WingetIntune/Graph/MobileAppsRequestBuilderExtensions.cs:line 15
   at WingetIntune.IntuneManager.PublishAppAsync(String packagesFolder, PackageInfo packageInfo, IntunePublishOptions options, CancellationToken cancellationToken) in /home/runner/work/WingetIntune/WingetIntune/src/WingetIntune/Intune/IntuneManager.cs:line 213
   at WingetIntune.IntuneManager.PublishAppAsync(String packagesFolder, PackageInfo packageInfo, IntunePublishOptions options, CancellationToken cancellationToken) in /home/runner/work/WingetIntune/WingetIntune/src/WingetIntune/Intune/IntuneManager.cs:line 280
   at WingetIntune.Commands.PublishCommand.HandleCommand(PublishCommandOptions options, InvocationContext context) in /home/runner/work/WingetIntune/WingetIntune/src/WingetIntune.Cli/Commands/PublishCommand.cs:line 105
   at System.CommandLine.NamingConventionBinder.CommandHandler.GetExitCodeAsync(Object returnValue, InvocationContext context)
   at System.CommandLine.NamingConventionBinder.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Hosting.HostingExtensions.<>c__DisplayClass1_0.<<UseHost>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
PS C:\Users\jeroe>

Windows version and current language

Windows 11 23H2 - English

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I won't demand an immediate answer
@BurgerhoutJ BurgerhoutJ added the bug Something isn't working label Jan 8, 2024
@svrooij
Copy link
Owner

svrooij commented Jan 9, 2024

Issue confirmed and fix almost ready:

info: WingetIntune.IntuneManager[6] Downloading logo from https://api.winstall.app/icons/Garmin.BaseCamp.png
info: WingetIntune.IntuneManager[0] Writing package readme for package Garmin.BaseCamp
info: WingetIntune.Commands.PackageCommand[0] Publishing package Garmin.BaseCamp 4.7.5.0
info: WingetIntune.IntuneManager[0] Created app eb20700a-842f-4309-9e16-88f4c0c643f0, starting with content
info: WingetIntune.Implementations.ChunkedAzureFileUploader[0] Uploading C:\Users\stephan\AppData\Local\Temp\cfb3ce51-7173-4fe3-aa29-f3dcf26802a9\IntuneWinPackage\Contents\IntunePackage.intunewin to xxx
info: WingetIntune.IntuneManager[0] Added content version 1 to app eb20700a-842f-4309-9e16-88f4c0c643f0
info: WingetIntune.IntuneManager[0] App CommitedContentVersion patched successfully
info: WingetIntune.Commands.PackageCommand[0] App Garmin.BaseCamp 4.7.5.0 created in Azure eb20700a-842f-4309-9e16-88f4c0c643f0

svrooij added a commit that referenced this issue Jan 9, 2024
@svrooij svrooij linked a pull request Jan 9, 2024 that will close this issue
@svrooij svrooij closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants