{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/cli/pulls/comments/88095716","pull_request_review_id":8679284,"id":88095716,"diff_hunk":"@@ -0,0 +1,107 @@\n+// Copyright (c) .NET Foundation and contributors. All rights reserved.\n+// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n+\n+using System.Collections.Generic;\n+using Microsoft.DotNet.Cli.CommandLine;\n+using Microsoft.DotNet.Cli.Utils;\n+using System;\n+using System.IO;\n+using System.Linq;\n+using Microsoft.Build.Construction;\n+using Microsoft.DotNet.ProjectJsonMigration;\n+\n+namespace Microsoft.DotNet.Tools.Ref\n+{\n+    public class RefCommand\n+    {\n+        public static int Run(string[] args)\n+        {\n+            DebugHelper.HandleDebugSwitch(ref args);\n+\n+            DirectoryInfo currDir = new DirectoryInfo(Directory.GetCurrentDirectory());","path":"src/dotnet/commands/dotnet-ref/Program.cs","position":21,"original_position":21,"commit_id":"0ecd404f2cbff7091d4999c88fbba7b9764ddaa9","original_commit_id":"0ecd404f2cbff7091d4999c88fbba7b9764ddaa9","user":{"login":"eerhardt","id":8291187,"avatar_url":"https://avatars.githubusercontent.com/u/8291187?v=3","gravatar_id":"","url":"https://api.github.com/users/eerhardt","html_url":"https://github.com/eerhardt","followers_url":"https://api.github.com/users/eerhardt/followers","following_url":"https://api.github.com/users/eerhardt/following{/other_user}","gists_url":"https://api.github.com/users/eerhardt/gists{/gist_id}","starred_url":"https://api.github.com/users/eerhardt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eerhardt/subscriptions","organizations_url":"https://api.github.com/users/eerhardt/orgs","repos_url":"https://api.github.com/users/eerhardt/repos","events_url":"https://api.github.com/users/eerhardt/events{/privacy}","received_events_url":"https://api.github.com/users/eerhardt/received_events","type":"User","site_admin":false},"body":"The project should be an optional parameter. And check the current directory if the project isn't specified.","created_at":"2016-11-15T19:37:37Z","updated_at":"2016-11-15T19:41:24Z","html_url":"https://github.com/dotnet/cli/pull/4706#discussion_r88095716","pull_request_url":"https://api.github.com/repos/dotnet/cli/pulls/4706","_links":{"self":{"href":"https://api.github.com/repos/dotnet/cli/pulls/comments/88095716"},"html":{"href":"https://github.com/dotnet/cli/pull/4706#discussion_r88095716"},"pull_request":{"href":"https://api.github.com/repos/dotnet/cli/pulls/4706"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/cli/pulls/4706","id":93525895,"html_url":"https://github.com/dotnet/cli/pull/4706","diff_url":"https://github.com/dotnet/cli/pull/4706.diff","patch_url":"https://github.com/dotnet/cli/pull/4706.patch","issue_url":"https://api.github.com/repos/dotnet/cli/issues/4706","number":4706,"state":"open","locked":false,"title":"Adds initial code for adding and removing a package reference","user":{"login":"Shazwazza","id":1742685,"avatar_url":"https://avatars.githubusercontent.com/u/1742685?v=3","gravatar_id":"","url":"https://api.github.com/users/Shazwazza","html_url":"https://github.com/Shazwazza","followers_url":"https://api.github.com/users/Shazwazza/followers","following_url":"https://api.github.com/users/Shazwazza/following{/other_user}","gists_url":"https://api.github.com/users/Shazwazza/gists{/gist_id}","starred_url":"https://api.github.com/users/Shazwazza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shazwazza/subscriptions","organizations_url":"https://api.github.com/users/Shazwazza/orgs","repos_url":"https://api.github.com/users/Shazwazza/repos","events_url":"https://api.github.com/users/Shazwazza/events{/privacy}","received_events_url":"https://api.github.com/users/Shazwazza/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nAt the MVP Summit Hackathon I created this ability via a dotnet extension however I realize that this functionality is supposed to be part of the core cli code so I'm submitting this as a PR.\r\n\r\nRelated Issue: https://github.com/dotnet/cli/issues/4521 \r\n\r\nI know this doesn't complete the functionality required for 4521 but it's a start.\r\n\r\n##Some notes about this:\r\n\r\n* This only deals with package references, not project references. \r\n* This follows the syntax as specified in https://github.com/dotnet/cli/issues/4521 \r\n* It will add or update a project reference with using `dotnet ref add`\r\n* Originally I did this using an MSBuild extension which allowed me to automatically get the location of the csproj, but to do this in the CLI project meant adding a few references in places they didn't already exist so I opted to finding the csproj file manually - I tried following the same format that's currently in this codebase so hopefully that is satisfactory\r\n* I could not get the entire project to build with the build.cmd script. It mostly builds but fails eventually with\r\n\r\n```\r\n\\TestAssets\\TestPackages\\dotnet-desktop-binding-redirects\\project.json(7,30): error NU1001: The dependency Newtonsoft.Json >= 5.0.0 could not be resolved. [X:\\Projects\\NETCLI\\Source\\build.proj]\r\n```\r\n\r\n* I wanted to create unit tests for this, however I could not get the other unit tests to run correctly. I tried to build some test projects manually such as: `/test/dotnet-new.Tests` by running `dotnet restore`, `dotnet build`, `dotnet test` but running the tests fail so I figured I must be missing something in order to get these tests to run and to use for my own.\r\n\r\n##Usage\r\n\r\n- this will default to using \"*\" as the version\r\n`dotnet ref add NewtonSoft.Json`\r\n- to specify specific version\r\n`dotnet ref add NewtonSoft.Json 9.0.1`\r\n- to remove\r\n`dotnet ref del NewtonSoft.Json`\r\n\r\n","created_at":"2016-11-14T08:35:43Z","updated_at":"2016-11-15T19:41:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d19744e0b165858360771b91ac71bdf042901c46","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/cli/pulls/4706/commits","review_comments_url":"https://api.github.com/repos/dotnet/cli/pulls/4706/comments","review_comment_url":"https://api.github.com/repos/dotnet/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/cli/issues/4706/comments","statuses_url":"https://api.github.com/repos/dotnet/cli/statuses/0ecd404f2cbff7091d4999c88fbba7b9764ddaa9","head":{"label":"Shazwazza:issue-4521","ref":"issue-4521","sha":"0ecd404f2cbff7091d4999c88fbba7b9764ddaa9","user":{"login":"Shazwazza","id":1742685,"avatar_url":"https://avatars.githubusercontent.com/u/1742685?v=3","gravatar_id":"","url":"https://api.github.com/users/Shazwazza","html_url":"https://github.com/Shazwazza","followers_url":"https://api.github.com/users/Shazwazza/followers","following_url":"https://api.github.com/users/Shazwazza/following{/other_user}","gists_url":"https://api.github.com/users/Shazwazza/gists{/gist_id}","starred_url":"https://api.github.com/users/Shazwazza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shazwazza/subscriptions","organizations_url":"https://api.github.com/users/Shazwazza/orgs","repos_url":"https://api.github.com/users/Shazwazza/repos","events_url":"https://api.github.com/users/Shazwazza/events{/privacy}","received_events_url":"https://api.github.com/users/Shazwazza/received_events","type":"User","site_admin":false},"repo":{"id":73401573,"name":"cli","full_name":"Shazwazza/cli","owner":{"login":"Shazwazza","id":1742685,"avatar_url":"https://avatars.githubusercontent.com/u/1742685?v=3","gravatar_id":"","url":"https://api.github.com/users/Shazwazza","html_url":"https://github.com/Shazwazza","followers_url":"https://api.github.com/users/Shazwazza/followers","following_url":"https://api.github.com/users/Shazwazza/following{/other_user}","gists_url":"https://api.github.com/users/Shazwazza/gists{/gist_id}","starred_url":"https://api.github.com/users/Shazwazza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shazwazza/subscriptions","organizations_url":"https://api.github.com/users/Shazwazza/orgs","repos_url":"https://api.github.com/users/Shazwazza/repos","events_url":"https://api.github.com/users/Shazwazza/events{/privacy}","received_events_url":"https://api.github.com/users/Shazwazza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Shazwazza/cli","description":"This repo contains the .NET Core command-line (CLI) tools, used for building .NET Core apps and libraries through your development flow (compiling, NuGet package management, running, testing, ...).","fork":true,"url":"https://api.github.com/repos/Shazwazza/cli","forks_url":"https://api.github.com/repos/Shazwazza/cli/forks","keys_url":"https://api.github.com/repos/Shazwazza/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shazwazza/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shazwazza/cli/teams","hooks_url":"https://api.github.com/repos/Shazwazza/cli/hooks","issue_events_url":"https://api.github.com/repos/Shazwazza/cli/issues/events{/number}","events_url":"https://api.github.com/repos/Shazwazza/cli/events","assignees_url":"https://api.github.com/repos/Shazwazza/cli/assignees{/user}","branches_url":"https://api.github.com/repos/Shazwazza/cli/branches{/branch}","tags_url":"https://api.github.com/repos/Shazwazza/cli/tags","blobs_url":"https://api.github.com/repos/Shazwazza/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shazwazza/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shazwazza/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shazwazza/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shazwazza/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/Shazwazza/cli/languages","stargazers_url":"https://api.github.com/repos/Shazwazza/cli/stargazers","contributors_url":"https://api.github.com/repos/Shazwazza/cli/contributors","subscribers_url":"https://api.github.com/repos/Shazwazza/cli/subscribers","subscription_url":"https://api.github.com/repos/Shazwazza/cli/subscription","commits_url":"https://api.github.com/repos/Shazwazza/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shazwazza/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shazwazza/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shazwazza/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shazwazza/cli/contents/{+path}","compare_url":"https://api.github.com/repos/Shazwazza/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shazwazza/cli/merges","archive_url":"https://api.github.com/repos/Shazwazza/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shazwazza/cli/downloads","issues_url":"https://api.github.com/repos/Shazwazza/cli/issues{/number}","pulls_url":"https://api.github.com/repos/Shazwazza/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/Shazwazza/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/Shazwazza/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shazwazza/cli/labels{/name}","releases_url":"https://api.github.com/repos/Shazwazza/cli/releases{/id}","deployments_url":"https://api.github.com/repos/Shazwazza/cli/deployments","created_at":"2016-11-10T16:44:43Z","updated_at":"2016-11-10T16:44:46Z","pushed_at":"2016-11-14T08:36:52Z","git_url":"git://github.com/Shazwazza/cli.git","ssh_url":"git@github.com:Shazwazza/cli.git","clone_url":"https://github.com/Shazwazza/cli.git","svn_url":"https://github.com/Shazwazza/cli","homepage":"https://docs.microsoft.com/dotnet/ ","size":24937,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"rel/1.0.0"}},"base":{"label":"dotnet:rel/1.0.0","ref":"rel/1.0.0","sha":"6d57ca7e140f945f182b75a836ad2a0a86dcbd67","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":43568107,"name":"cli","full_name":"dotnet/cli","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/cli","description":"This repo contains the .NET Core command-line (CLI) tools, used for building .NET Core apps and libraries through your development flow (compiling, NuGet package management, running, testing, ...).","fork":false,"url":"https://api.github.com/repos/dotnet/cli","forks_url":"https://api.github.com/repos/dotnet/cli/forks","keys_url":"https://api.github.com/repos/dotnet/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/cli/teams","hooks_url":"https://api.github.com/repos/dotnet/cli/hooks","issue_events_url":"https://api.github.com/repos/dotnet/cli/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/cli/events","assignees_url":"https://api.github.com/repos/dotnet/cli/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/cli/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/cli/tags","blobs_url":"https://api.github.com/repos/dotnet/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/cli/languages","stargazers_url":"https://api.github.com/repos/dotnet/cli/stargazers","contributors_url":"https://api.github.com/repos/dotnet/cli/contributors","subscribers_url":"https://api.github.com/repos/dotnet/cli/subscribers","subscription_url":"https://api.github.com/repos/dotnet/cli/subscription","commits_url":"https://api.github.com/repos/dotnet/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/cli/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/cli/merges","archive_url":"https://api.github.com/repos/dotnet/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/cli/downloads","issues_url":"https://api.github.com/repos/dotnet/cli/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/cli/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/cli/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/cli/deployments","created_at":"2015-10-02T18:03:15Z","updated_at":"2016-11-15T18:33:55Z","pushed_at":"2016-11-15T19:12:34Z","git_url":"git://github.com/dotnet/cli.git","ssh_url":"git@github.com:dotnet/cli.git","clone_url":"https://github.com/dotnet/cli.git","svn_url":"https://github.com/dotnet/cli","homepage":"https://docs.microsoft.com/dotnet/ ","size":122591,"stargazers_count":1565,"watchers_count":1565,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":411,"mirror_url":null,"open_issues_count":501,"forks":411,"open_issues":501,"watchers":1565,"default_branch":"rel/1.0.0"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/cli/pulls/4706"},"html":{"href":"https://github.com/dotnet/cli/pull/4706"},"issue":{"href":"https://api.github.com/repos/dotnet/cli/issues/4706"},"comments":{"href":"https://api.github.com/repos/dotnet/cli/issues/4706/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/cli/pulls/4706/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/cli/pulls/4706/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/cli/statuses/0ecd404f2cbff7091d4999c88fbba7b9764ddaa9"}}}}
{"actor":{"display_login":"eerhardt"}}