{"action":"created","comment":{"url":"https://api.github.com/repos/NuGet/NuGet3/pulls/comments/40701724","id":40701724,"diff_hunk":"@@ -167,19 +167,108 @@ public void PackagesConfigReader_InvalidAllowedVersions()\n         [Fact]\n         public void PackagesConfigReader_DuplicateEntries()\n         {\n+            // Arrange\n             var doc = XDocument.Parse(\n-@\"<?xml version=\"\"1.0\"\" encoding=\"\"utf-8\"\"?>\n-<packages>\n-  <package id=\"\"test1\"\" version=\"\"1.0\"\"/>\n-  <package id=\"\"test1\"\" version=\"\"1.0\"\"/>\n+                @\"<?xml version=\"\"1.0\"\" encoding=\"\"utf-8\"\"?>\n+                <packages>\n+                  <package id=\"\"test1\"\" version=\"\"1.0\"\"/>\n+                  <package id=\"\"test1\"\" version=\"\"1.0\"\"/>\n+\n+                  <package id=\"\"test2\"\" version=\"\"1.0\"\"/>\n+                  <package id=\"\"test2\"\" version=\"\"1.0\"\"/>\n+                </packages>\");\n+            var reader = new PackagesConfigReader(doc);\n \n-  <package id=\"\"test2\"\" version=\"\"1.0\"\"/>\n-  <package id=\"\"test2\"\" version=\"\"1.0\"\"/>\n-</packages>\");\n+            // Act\n+            var ex = Assert.Throws<PackagesConfigReaderException>(() => reader.GetPackages());\n+\n+            // Assert\n+            Assert.Equal(ex.Message, \"There are duplicate packages: test1, test2\");\n+        }\n+\n+        [Fact]\n+        public void PackagesConfigReader_DuplicateEntries_Casing()\n+        {\n+            // Arrange\n+            var doc = XDocument.Parse(\n+                @\"<?xml version=\"\"1.0\"\" encoding=\"\"utf-8\"\"?>\n+                <packages>\n+                  <package id=\"\"test1\"\" version=\"\"1.0\"\"/>\n+                  <package id=\"\"TEST1\"\" version=\"\"1.0\"\"/>\n+\n+                  <package id=\"\"test2\"\" version=\"\"1.0\"\"/>\n+                  <package id=\"\"TEST2\"\" version=\"\"1.0\"\"/>\n+                </packages>\");\n             var reader = new PackagesConfigReader(doc);\n \n+            // Act\n             var ex = Assert.Throws<PackagesConfigReaderException>(() => reader.GetPackages());\n+\n+            // Assert\n             Assert.Equal(ex.Message, \"There are duplicate packages: test1, test2\");\n         }\n+\n+        [Fact]\n+        public void PackagesConfigReader_AllowDuplicateEntriesFailOnDuplicateVersions()\n+        {\n+            // Arrange\n+            var doc = XDocument.Parse(\n+                @\"<?xml version=\"\"1.0\"\" encoding=\"\"utf-8\"\"?>\n+                <packages>\n+                  <package id=\"\"test1\"\" version=\"\"1.0\"\"/>\n+                  <package id=\"\"test1\"\" version=\"\"1.0\"\"/>\n+                  <package id=\"\"test2\"\" version=\"\"1.0\"\"/>\n+                  <package id=\"\"test2\"\" version=\"\"2.0\"\"/>\n+                </packages>\");\n+            var reader = new PackagesConfigReader(doc);\n+\n+            // Act\n+            var ex = Assert.Throws<PackagesConfigReaderException>(() => \n+                reader.GetPackages(allowDuplicatePackageIds: true));\n+\n+            // Assert\n+            Assert.Equal(ex.Message, \"There are duplicate packages: test1.1.0.0\");","path":"test/NuGet.Packaging.Test/PackagesConfigReaderTests.cs","position":71,"original_position":71,"commit_id":"8de870a69fbefd69d19bc162303462d6a552b4b5","original_commit_id":"8de870a69fbefd69d19bc162303462d6a552b4b5","user":{"login":"danliu","id":1087852,"avatar_url":"https://avatars.githubusercontent.com/u/1087852?v=3","gravatar_id":"","url":"https://api.github.com/users/danliu","html_url":"https://github.com/danliu","followers_url":"https://api.github.com/users/danliu/followers","following_url":"https://api.github.com/users/danliu/following{/other_user}","gists_url":"https://api.github.com/users/danliu/gists{/gist_id}","starred_url":"https://api.github.com/users/danliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliu/subscriptions","organizations_url":"https://api.github.com/users/danliu/orgs","repos_url":"https://api.github.com/users/danliu/repos","events_url":"https://api.github.com/users/danliu/events{/privacy}","received_events_url":"https://api.github.com/users/danliu/received_events","type":"User","site_admin":false},"body":"I understand the duplicate is test1, version 1.0.0 as the normalized version. But in the packages config itself it says 1.0.\r\n\r\nInstead of using packageIdentity.ToString(), can you output something that matches what's shown on the packages.config file? So when user goes to packages.config to find the duplicate, it's easy for them to get what has been duplicated.","created_at":"2015-09-29T17:31:57Z","updated_at":"2015-09-29T17:31:57Z","html_url":"https://github.com/NuGet/NuGet3/pull/134#discussion_r40701724","pull_request_url":"https://api.github.com/repos/NuGet/NuGet3/pulls/134","_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGet3/pulls/comments/40701724"},"html":{"href":"https://github.com/NuGet/NuGet3/pull/134#discussion_r40701724"},"pull_request":{"href":"https://api.github.com/repos/NuGet/NuGet3/pulls/134"}}},"pull_request":{"url":"https://api.github.com/repos/NuGet/NuGet3/pulls/134","id":46212062,"html_url":"https://github.com/NuGet/NuGet3/pull/134","diff_url":"https://github.com/NuGet/NuGet3/pull/134.diff","patch_url":"https://github.com/NuGet/NuGet3/pull/134.patch","issue_url":"https://api.github.com/repos/NuGet/NuGet3/issues/134","number":134,"state":"open","locked":false,"title":"PackagesConfigReader support for duplicate package id entries (part 1)","user":{"login":"emgarten","id":6381138,"avatar_url":"https://avatars.githubusercontent.com/u/6381138?v=3","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},"body":"This change adds a flag on GetPackages to allow the packages.config reader to return entries with duplicate package ids for the solution level package restore scenario.\r\n\r\nPackage versions will always be verified, if two identical packages exist in packages.config an exception will be thrown.\r\n\r\nBy default duplicate ids are not allowed, this flag will only be set in the command line. When the vsix supports solution level packages again it will be used there also for the solution level config.\r\n\r\n//cc @danliu @feiling @deepakaravindr @yishaigalatzer \r\n","created_at":"2015-09-28T21:44:07Z","updated_at":"2015-09-29T17:31:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f5a0e2aaafa0ac5b84a8fd5f02b270e98053dd32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NuGet/NuGet3/pulls/134/commits","review_comments_url":"https://api.github.com/repos/NuGet/NuGet3/pulls/134/comments","review_comment_url":"https://api.github.com/repos/NuGet/NuGet3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NuGet/NuGet3/issues/134/comments","statuses_url":"https://api.github.com/repos/NuGet/NuGet3/statuses/8de870a69fbefd69d19bc162303462d6a552b4b5","head":{"label":"NuGet:emgarten/packagesConfigDuplicates","ref":"emgarten/packagesConfigDuplicates","sha":"8de870a69fbefd69d19bc162303462d6a552b4b5","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":31300058,"name":"NuGet3","full_name":"NuGet/NuGet3","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGet3","description":"","fork":false,"url":"https://api.github.com/repos/NuGet/NuGet3","forks_url":"https://api.github.com/repos/NuGet/NuGet3/forks","keys_url":"https://api.github.com/repos/NuGet/NuGet3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGet3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGet3/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGet3/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGet3/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGet3/events","assignees_url":"https://api.github.com/repos/NuGet/NuGet3/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGet3/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGet3/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGet3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGet3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGet3/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGet3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGet3/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGet3/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGet3/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGet3/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGet3/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGet3/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGet3/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGet3/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGet3/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGet3/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGet3/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGet3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGet3/merges","archive_url":"https://api.github.com/repos/NuGet/NuGet3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGet3/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGet3/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGet3/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGet3/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGet3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGet3/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGet3/releases{/id}","created_at":"2015-02-25T06:15:00Z","updated_at":"2015-09-25T19:57:02Z","pushed_at":"2015-09-29T07:33:03Z","git_url":"git://github.com/NuGet/NuGet3.git","ssh_url":"git@github.com:NuGet/NuGet3.git","clone_url":"https://github.com/NuGet/NuGet3.git","svn_url":"https://github.com/NuGet/NuGet3","homepage":null,"size":14686,"stargazers_count":51,"watchers_count":51,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":11,"forks":24,"open_issues":11,"watchers":51,"default_branch":"dev"}},"base":{"label":"NuGet:dev","ref":"dev","sha":"2ae84e2d251be26217bcc552501de6bad2e9eb7d","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":31300058,"name":"NuGet3","full_name":"NuGet/NuGet3","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGet3","description":"","fork":false,"url":"https://api.github.com/repos/NuGet/NuGet3","forks_url":"https://api.github.com/repos/NuGet/NuGet3/forks","keys_url":"https://api.github.com/repos/NuGet/NuGet3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGet3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGet3/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGet3/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGet3/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGet3/events","assignees_url":"https://api.github.com/repos/NuGet/NuGet3/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGet3/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGet3/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGet3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGet3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGet3/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGet3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGet3/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGet3/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGet3/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGet3/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGet3/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGet3/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGet3/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGet3/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGet3/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGet3/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGet3/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGet3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGet3/merges","archive_url":"https://api.github.com/repos/NuGet/NuGet3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGet3/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGet3/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGet3/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGet3/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGet3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGet3/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGet3/releases{/id}","created_at":"2015-02-25T06:15:00Z","updated_at":"2015-09-25T19:57:02Z","pushed_at":"2015-09-29T07:33:03Z","git_url":"git://github.com/NuGet/NuGet3.git","ssh_url":"git@github.com:NuGet/NuGet3.git","clone_url":"https://github.com/NuGet/NuGet3.git","svn_url":"https://github.com/NuGet/NuGet3","homepage":null,"size":14686,"stargazers_count":51,"watchers_count":51,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":11,"forks":24,"open_issues":11,"watchers":51,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGet3/pulls/134"},"html":{"href":"https://github.com/NuGet/NuGet3/pull/134"},"issue":{"href":"https://api.github.com/repos/NuGet/NuGet3/issues/134"},"comments":{"href":"https://api.github.com/repos/NuGet/NuGet3/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/NuGet/NuGet3/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/NuGet/NuGet3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NuGet/NuGet3/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/NuGet/NuGet3/statuses/8de870a69fbefd69d19bc162303462d6a552b4b5"}}}}