question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyNotFoundException is thrown for every package found when trying to install.

See original GitHub issue

Describe the bug KeyNotFoundException is thrown for every package found when trying to install.

KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary2[TKey,TValue].get_Item (TKey key) (at <7ba07f088431485bb722f3b3373e87ee>:0) Coffee.UpmGitExtension.PackageUtils+<>c__DisplayClass2_0.<InstallPackage>b__0 (System.Collections.Generic.Dictionary2[TKey,TValue] manifest) (at Library/PackageCache/com.coffee.upm-git-extension@1.1.0-preview.13/Editor/Coffee.UpmGitExtension/Utils.cs:136) Coffee.UpmGitExtension.PackageUtils.UpdateManifestJson (System.Action1[T] action) (at Library/PackageCache/com.coffee.upm-git-extension@1.1.0-preview.13/Editor/Coffee.UpmGitExtension/Utils.cs:167) Coffee.UpmGitExtension.PackageUtils.InstallPackage (System.String packageName, System.String repoUrl, System.String refName) (at Library/PackageCache/com.coffee.upm-git-extension@1.1.0-preview.13/Editor/Coffee.UpmGitExtension/Utils.cs:126) Coffee.UpmGitExtension.InstallPackageWindow.onClick_InstallPackage () (at Library/PackageCache/com.coffee.upm-git-extension@1.1.0-preview.13/Editor/Coffee.UpmGitExtension/UI/InstallPackageWindow.cs:186) UnityEngine.Experimental.UIElements.Clickable.OnMouseUp (UnityEngine.Experimental.UIElements.MouseUpEvent evt) (at C:/buildslave/unity/build/Modules/UIElements/Clickable.cs:152) UnityEngine.Experimental.UIElements.EventCallbackFunctor1[TEventType].Invoke (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/Events/EventCallback.cs:62) UnityEngine.Experimental.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/Events/EventCallbackRegistry.cs:376) UnityEngine.Experimental.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/Events/EventHandler.cs:112) UnityEngine.Experimental.UIElements.EventDispatcher.ProcessEvent (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:511) UnityEngine.Experimental.UIElements.EventDispatcher.Dispatch (UnityEngine.Experimental.UIElements.EventBase evt, UnityEngine.Experimental.UIElements.IPanel panel, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:307) UnityEngine.Experimental.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.Experimental.UIElements.EventBase e, UnityEngine.Experimental.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:176) UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:245) UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:68) UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

To Reproduce Steps to reproduce the behavior:

  1. Install the UpmGitExtension
  2. Create a repository and create a package to be imported (this repo is private)
  3. Click the Package Manager UPM orange button in the bottom left to add the package
  4. Enter the package repo url
  5. Search for the repo package
  6. Note that the package is found successfully
  7. Pick a version from the dropdown to install (all versions appear for me)
  8. Press the button to install the version
  9. Error is thrown in the console

Expected behavior Package should be imported

Environment

  • Version 1.1.0 preview 13
  • Platform: Windows 10
  • Unity version: 2018.4.10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TCROCcommented, Aug 7, 2020

@mob-sakai @cookie966507 I think we are good to close this issue now

1reaction
TCROCcommented, Jul 12, 2020

@mob-sakai I opened up a pull request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`dotnet workload` fails with KeyNotFoundException after ...
i tried it now a second time and uninstalled all sdks and did a new install of sdk 6.0.401. after that install only...
Read more >
KeyNotFoundException Class (System.Collections.Generic)
A KeyNotFoundException is thrown when an operation attempts to retrieve an element from a collection using a key that does not exist in...
Read more >
c# - When KeyNotFoundException is thrown, how do I see ...
1. Looks like try/catch is redundant in setter because new entry should be created in case of the new key · Also, in...
Read more >
given key was not present in the dictionary and create ...
Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. Source Error: An unhandled exception was generated ...
Read more >
keynotfoundexception in publishedcache - Bugs / Questions
I seem to have a problem when getting data from a TerraType field. But the weirdest thing is, it doesn't happen every time....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found