{"action":"created","issue":{"url":"https://api.github.com/repos/NuGet/Home/issues/6256","repository_url":"https://api.github.com/repos/NuGet/Home","labels_url":"https://api.github.com/repos/NuGet/Home/issues/6256/labels{/name}","comments_url":"https://api.github.com/repos/NuGet/Home/issues/6256/comments","events_url":"https://api.github.com/repos/NuGet/Home/issues/6256/events","html_url":"https://github.com/NuGet/Home/issues/6256","id":279364077,"number":6256,"title":"regression from 4.3 - nuget install w/ excludeversion flag fails in many cases","user":{"login":"jaknor","id":1318087,"avatar_url":"https://avatars3.githubusercontent.com/u/1318087?v=4","gravatar_id":"","url":"https://api.github.com/users/jaknor","html_url":"https://github.com/jaknor","followers_url":"https://api.github.com/users/jaknor/followers","following_url":"https://api.github.com/users/jaknor/following{/other_user}","gists_url":"https://api.github.com/users/jaknor/gists{/gist_id}","starred_url":"https://api.github.com/users/jaknor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaknor/subscriptions","organizations_url":"https://api.github.com/users/jaknor/orgs","repos_url":"https://api.github.com/users/jaknor/repos","events_url":"https://api.github.com/users/jaknor/events{/privacy}","received_events_url":"https://api.github.com/users/jaknor/received_events","type":"User","site_admin":false},"labels":[{"id":430514155,"url":"https://api.github.com/repos/NuGet/Home/labels/Area:Install","name":"Area:Install","color":"f7c6c7","default":false},{"id":171462723,"url":"https://api.github.com/repos/NuGet/Home/labels/Priority:0","name":"Priority:0","color":"fbca04","default":false},{"id":663906418,"url":"https://api.github.com/repos/NuGet/Home/labels/Regression","name":"Regression","color":"207de5","default":false},{"id":802182975,"url":"https://api.github.com/repos/NuGet/Home/labels/Sprint%20130","name":"Sprint 130","color":"fbca04","default":false},{"id":280103869,"url":"https://api.github.com/repos/NuGet/Home/labels/Up%20for%20Grabs","name":"Up for Grabs","color":"682A7B","default":false}],"state":"closed","locked":false,"assignee":{"login":"emgarten","id":6381138,"avatar_url":"https://avatars2.githubusercontent.com/u/6381138?v=4","gravatar_id":"","url":"https://api.github.com/users/emgarten","html_url":"https://github.com/emgarten","followers_url":"https://api.github.com/users/emgarten/followers","following_url":"https://api.github.com/users/emgarten/following{/other_user}","gists_url":"https://api.github.com/users/emgarten/gists{/gist_id}","starred_url":"https://api.github.com/users/emgarten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emgarten/subscriptions","organizations_url":"https://api.github.com/users/emgarten/orgs","repos_url":"https://api.github.com/users/emgarten/repos","events_url":"https://api.github.com/users/emgarten/events{/privacy}","received_events_url":"https://api.github.com/users/emgarten/received_events","type":"User","site_admin":false},"assignees":[{"login":"emgarten","id":6381138,"avatar_url":"https://avatars2.githubusercontent.com/u/6381138?v=4","gravatar_id":"","url":"https://api.github.com/users/emgarten","html_url":"https://github.com/emgarten","followers_url":"https://api.github.com/users/emgarten/followers","following_url":"https://api.github.com/users/emgarten/following{/other_user}","gists_url":"https://api.github.com/users/emgarten/gists{/gist_id}","starred_url":"https://api.github.com/users/emgarten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emgarten/subscriptions","organizations_url":"https://api.github.com/users/emgarten/orgs","repos_url":"https://api.github.com/users/emgarten/repos","events_url":"https://api.github.com/users/emgarten/events{/privacy}","received_events_url":"https://api.github.com/users/emgarten/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/NuGet/Home/milestones/67","html_url":"https://github.com/NuGet/Home/milestone/67","labels_url":"https://api.github.com/repos/NuGet/Home/milestones/67/labels","id":2686855,"number":67,"title":"Backlog","description":"These issues are important enough to keep around.\r\nWe'll fix them in priority order. We use labels to mark priority. \r\nPriorities may change based on customer feedback.","creator":{"login":"rrelyea","id":8865080,"avatar_url":"https://avatars1.githubusercontent.com/u/8865080?v=4","gravatar_id":"","url":"https://api.github.com/users/rrelyea","html_url":"https://github.com/rrelyea","followers_url":"https://api.github.com/users/rrelyea/followers","following_url":"https://api.github.com/users/rrelyea/following{/other_user}","gists_url":"https://api.github.com/users/rrelyea/gists{/gist_id}","starred_url":"https://api.github.com/users/rrelyea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrelyea/subscriptions","organizations_url":"https://api.github.com/users/rrelyea/orgs","repos_url":"https://api.github.com/users/rrelyea/repos","events_url":"https://api.github.com/users/rrelyea/events{/privacy}","received_events_url":"https://api.github.com/users/rrelyea/received_events","type":"User","site_admin":false},"open_issues":755,"closed_issues":92,"state":"open","created_at":"2017-08-07T23:11:02Z","updated_at":"2018-03-28T01:13:03Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2017-12-05T12:52:24Z","updated_at":"2018-03-28T08:31:38Z","closed_at":"2018-01-29T20:35:23Z","author_association":"NONE","body":"## Description\r\nHi, we have started receiving errors when trying to install a nuget package in some of our build scripts.\r\n\r\nOur build scripts downloads the latest version of nuget.exe from https://dist.nuget.org/win-x86-commandline/latest/nuget.exe. It uses that to install and restore packages in our solutions. When nuget 4.4.1 was released we started getting errors when building some of the solutions. The error message is \"An item with the same key has already been added.\".\r\n\r\nAfter some investigation I have narrowed it down to the following. For one of our packages we install the package using the -excludeVersion flag. This seems to be causing an issue if you have multiple versions of the same package in your packages folder.\r\n\r\n## Details about Problem\r\n\r\nProduct: NuGet.exe\r\n\r\nVersion: 4.4.1 & 4.5.0\r\n\r\nOS version: Win10 v1607 (14393.1770)\r\n\r\nWorked before? If so, with which NuGet version:\r\nYes in version 4.3.0\r\n\r\n## Detailed repro steps so we can see the same problem\r\n\r\nPlease see this repository: https://github.com/jaknor/NugetError\r\n\r\n## Other suggested things\r\n\r\n### Verbose Logs\r\n\r\nNuGet Version: 4.4.1.4656\r\nFeeds used:\r\n  http://nuget.moonpig.com/nuget\r\n  https://api.nuget.org/v3/index.json\r\n  C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\\r\n\r\nInstalling package 'stylecop.msbuild' to 'packages'.\r\n  GET http://nuget.moonpig.com/nuget/FindPackagesById()?id='stylecop.msbuild'&semVerLevel=2.0.0\r\n  GET https://api.nuget.org/v3/registration3-gz-semver2/stylecop.msbuild/index.json\r\n  OK http://nuget.moonpig.com/nuget/FindPackagesById()?id='stylecop.msbuild'&semVerLevel=2.0.0 22ms\r\n  OK https://api.nuget.org/v3/registration3-gz-semver2/stylecop.msbuild/index.json 410ms\r\n\r\n\r\nAttempting to gather dependency information for package 'stylecop.msbuild.5.0.0' with respect to project 'packages', targeting 'Any,Version=v0.0'\r\nPackage stylecop.msbuild from source MoonpigNuget gathered from cache.\r\nPackage stylecop.msbuild from source Microsoft Visual Studio Offline Packages gathered from cache.\r\nPackage stylecop.msbuild from source nuget.org gathered from cache.\r\n  GET http://nuget.moonpig.com/nuget/FindPackagesById()?id='NewId'&semVerLevel=2.0.0\r\n  GET https://api.nuget.org/v3/registration3-gz-semver2/masstransit/index.json\r\n  GET http://nuget.moonpig.com/nuget/FindPackagesById()?id='MassTransit'&semVerLevel=2.0.0\r\n  GET http://nuget.moonpig.com/nuget/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0\r\n  GET https://api.nuget.org/v3/registration3-gz-semver2/newid/index.json\r\n  GET https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/index.json\r\n  OK http://nuget.moonpig.com/nuget/FindPackagesById()?id='NewId'&semVerLevel=2.0.0 27ms\r\n  OK http://nuget.moonpig.com/nuget/FindPackagesById()?id='MassTransit'&semVerLevel=2.0.0 34ms\r\n  OK http://nuget.moonpig.com/nuget/FindPackagesById()?id='Newtonsoft.Json'&semVerLevel=2.0.0 38ms\r\n  OK https://api.nuget.org/v3/registration3-gz-semver2/newid/index.json 118ms\r\n  OK https://api.nuget.org/v3/registration3-gz-semver2/masstransit/index.json 195ms\r\n  GET http://nuget.moonpig.com/nuget/FindPackagesById()?id='GreenPipes'&semVerLevel=2.0.0\r\n  GET https://api.nuget.org/v3/registration3-gz-semver2/greenpipes/index.json\r\n  GET http://nuget.moonpig.com/nuget/FindPackagesById()?id='Newtonsoft.Json.Bson'&semVerLevel=2.0.0\r\n  GET https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json.bson/index.json\r\n  OK http://nuget.moonpig.com/nuget/FindPackagesById()?id='GreenPipes'&semVerLevel=2.0.0 19ms\r\n  OK http://nuget.moonpig.com/nuget/FindPackagesById()?id='Newtonsoft.Json.Bson'&semVerLevel=2.0.0 19ms\r\n  OK https://api.nuget.org/v3/registration3-gz-semver2/greenpipes/index.json 101ms\r\n  OK https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json/index.json 407ms\r\n  OK https://api.nuget.org/v3/registration3-gz-semver2/newtonsoft.json.bson/index.json 394ms\r\nTotal number of results gathered : 25\r\nGathering dependency information took 653.04 ms\r\nSummary of time taken to gather dependencies per source :\r\npackages        -       9.38 ms\r\nhttp://nuget.moonpig.com/nuget  -       160.48 ms\r\nC:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\    -       39.48 ms\r\nhttps://api.nuget.org/v3/index.json     -       1.27 sec\r\nAn item with the same key has already been added.\r\nSystem.InvalidOperationException: An item with the same key has already been added. ---> System.ArgumentException: An item with the same key has already been added.\r\n   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)\r\n   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)\r\n   at NuGet.PackageManagement.PrunePackageTree.PruneDowngrades(IEnumerable`1 packages, IEnumerable`1 packageReferences)\r\n   at NuGet.PackageManagement.NuGetPackageManager.<PreviewInstallPackageAsync>d__65.MoveNext()\r\n   --- End of inner exception stack trace ---\r\n   at NuGet.PackageManagement.NuGetPackageManager.<PreviewInstallPackageAsync>d__65.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NuGet.PackageManagement.NuGetPackageManager.<InstallPackageAsync>d__48.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NuGet.CommandLine.InstallCommand.<InstallPackageAsync>d__40.MoveNext()\r\n\r\n### Sample Project\r\n\r\nPlease see this repository: https://github.com/jaknor/NugetError\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NuGet/Home/issues/comments/376805498","html_url":"https://github.com/NuGet/Home/issues/6256#issuecomment-376805498","issue_url":"https://api.github.com/repos/NuGet/Home/issues/6256","id":376805498,"user":{"login":"piers7","id":2077685,"avatar_url":"https://avatars1.githubusercontent.com/u/2077685?v=4","gravatar_id":"","url":"https://api.github.com/users/piers7","html_url":"https://github.com/piers7","followers_url":"https://api.github.com/users/piers7/followers","following_url":"https://api.github.com/users/piers7/following{/other_user}","gists_url":"https://api.github.com/users/piers7/gists{/gist_id}","starred_url":"https://api.github.com/users/piers7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piers7/subscriptions","organizations_url":"https://api.github.com/users/piers7/orgs","repos_url":"https://api.github.com/users/piers7/repos","events_url":"https://api.github.com/users/piers7/events{/privacy}","received_events_url":"https://api.github.com/users/piers7/received_events","type":"User","site_admin":false},"created_at":"2018-03-28T08:31:38Z","updated_at":"2018-03-28T08:31:38Z","author_association":"NONE","body":"Based on playing a fun game of follow-the-commit, it seems that surely this should be tagged with the 4.7 milestone, not backlog:\r\n\r\nhttps://github.com/NuGet/NuGet.Client/commit/b7894380f06bd6fb9ee050a1348fb0dd44c367ca\r\n\r\nAside: when end-users arrive here they're already _distinctly unimpressed_ that something's not working, added to by however hard they found it to locate this issue. Making them jump through hoops to determine if the fix is/isn't in a release they can download is like rubbing salt in the wound and poking them in the eye at the same time."}}
{"actor":{"display_login":"piers7"}}