{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Docs/pulls/comments/68481352","id":68481352,"diff_hunk":"@@ -0,0 +1,200 @@\n+.. _dotnet-watch:\n+\n+Developing ASP.NET applications using dotnet watch\n+==================================================\n+\n+By `Victor Hurdugaci`_\n+\n+Introduction\n+------------\n+\n+``dotnet watch`` is a development time tool that runs a ``dotnet`` command when source files change. It can be used to compile, run tests, or publish when code changes.\n+\n+In this tutorial we'll use an existing WebApi application that calculates the sum and product of two numbers to demonstrate the use cases of ``dotnet watch``. The sample application contains an intentional bug that we'll fix as part of this tutorial.\n+\n+Getting started\n+---------------\n+\n+Start by downloading `the sample application <https://github.com/aspnet/Docs/tree/master/aspnet/tutorials/dotnet-watch/sample>`__. It contains two projects, ``WebApp`` (a web application) and ``WebAppTests`` (unit tests for the web application)\n+\n+In a console, open the folder where you downloaded the sample application and run:\n+\n+1.  ``dotnet restore``\n+2.  ``cd WebApp``\n+3.  ``dotnet run``\n+\n+The console output will show messages similar to the ones below, indicating that the application is now running and waiting for requests:\n+\n+.. code-block:: bash\n+\n+  user$ dotnet run\n+  Project WebApp (.NETCoreApp,Version=v1.0) will be compiled because inputs were modified\n+  Compiling WebApp for .NETCoreApp,Version=v1.0\n+\n+  Compilation succeeded.\n+    0 Warning(s)\n+    0 Error(s)\n+\n+  Time elapsed 00:00:02.6049991\n+\n+  Hosting environment: Production\n+  Content root path: /Users/user/dev/aspnet/Docs/aspnet/tutorials/dotnet-watch/sample/WebApp\n+  Now listening on: http://localhost:5000\n+  Application started. Press Ctrl+C to shut down.\n+\n+In a web browser, navigate to ``http://localhost:5000/api/math/sum?a=4&b=5`` and you should see the result ``9``.\n+\n+If you navigate to ``http://localhost:5000/api/math/product?a=4&b=5`` instead, you'd expect to get the result ``20``. Instead, you get ``9`` again.\n+\n+We'll fix that.\n+\n+Adding ``dotnet watch`` to a project\n+------------------------------------\n+\n+1. Add ``Microsoft.DotNet.Watcher.Tools`` to the ``tools`` section of the ``WebApp/project.json`` file as in the example below:\n+\n+.. literalinclude:: dotnet-watch/sample/WebAppTests/project.json\n+   :language: javascript\n+   :lines: 21-23\n+   :emphasize-lines: 2\n+   :dedent: 2\n+\n+2. Run ``dotnet restore``.\n+\n+The console output will show messages similar to the ones below:\n+\n+.. code-block:: bash\n+\n+  log  : Restoring packages for /Users/user/dev/aspnet/Docs/aspnet/tutorials/dotnet-watch/sample/WebApp/project.json...\n+  log  : Restoring packages for tool 'Microsoft.DotNet.Watcher.Tools' in /Users/user/dev/aspnet/Docs/aspnet/tutorials/dotnet-watch/sample/WebApp/project.json...\n+  log  : Installing Microsoft.DotNet.Watcher.Core 1.0.0-preview2-final.\n+  log  : Installing Microsoft.DotNet.Watcher.Tools 1.0.0-preview2-final.\n+\n+Running ``dotnet`` commands using ``dotnet watch``\n+--------------------------------------------------\n+\n+Any ``dotnet`` command can be run with  ``dotnet watch``:  For example:\n+\n+========================================= ======================================\n+Command                                   Command with watch\n+========================================= ======================================\n+``dotnet run``                            ``dotnet watch run``\n+``dotnet run --f net451``                 ``dotnet watch run --f net451``\n+``dotnet run --f net451 -- -arg1``        ``dotnet watch run -f net451 -- -arg1``\n+``dotnet test``                           ``dotnet watch test``\n+========================================= ======================================\n+\n+To run ``WebApp`` using the watcher, run ``dotnet watch run`` in the ``WebApp`` folder. The console output will show messages similar to the ones below, indicating that ``dotnet watch`` is now watching code files:\n+\n+.. code-block:: bash\n+\n+  user$ dotnet watch run\n+  [DotNetWatcher] info: Running dotnet with the following arguments: run\n+  [DotNetWatcher] info: dotnet process id: 39746\n+  Project WebApp (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.\n+  Hosting environment: Production\n+  Content root path: /Users/user/dev/aspnet/Docs/aspnet/tutorials/dotnet-watch/sample/WebApp\n+  Now listening on: http://localhost:5000\n+  Application started. Press Ctrl+C to shut down.\n+\n+Making changes with ``dotnet watch``\n+------------------------------------","path":"aspnet/tutorials/dotnet-watch.rst","position":101,"original_position":101,"commit_id":"05c73187f8db71b7960171ddf60060b9d5f28a10","original_commit_id":"05c73187f8db71b7960171ddf60060b9d5f28a10","user":{"login":"BrennanConroy","id":7574801,"avatar_url":"https://avatars.githubusercontent.com/u/7574801?v=3","gravatar_id":"","url":"https://api.github.com/users/BrennanConroy","html_url":"https://github.com/BrennanConroy","followers_url":"https://api.github.com/users/BrennanConroy/followers","following_url":"https://api.github.com/users/BrennanConroy/following{/other_user}","gists_url":"https://api.github.com/users/BrennanConroy/gists{/gist_id}","starred_url":"https://api.github.com/users/BrennanConroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrennanConroy/subscriptions","organizations_url":"https://api.github.com/users/BrennanConroy/orgs","repos_url":"https://api.github.com/users/BrennanConroy/repos","events_url":"https://api.github.com/users/BrennanConroy/events{/privacy}","received_events_url":"https://api.github.com/users/BrennanConroy/received_events","type":"User","site_admin":false},"body":"Here you are starting another section, you should say something about \"make sure you have dotnet watch running on the WebApp\"","created_at":"2016-06-25T01:16:40Z","updated_at":"2016-06-25T01:16:40Z","html_url":"https://github.com/aspnet/Docs/pull/1515#discussion_r68481352","pull_request_url":"https://api.github.com/repos/aspnet/Docs/pulls/1515","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/comments/68481352"},"html":{"href":"https://github.com/aspnet/Docs/pull/1515#discussion_r68481352"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/1515"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Docs/pulls/1515","id":75182510,"html_url":"https://github.com/aspnet/Docs/pull/1515","diff_url":"https://github.com/aspnet/Docs/pull/1515.diff","patch_url":"https://github.com/aspnet/Docs/pull/1515.patch","issue_url":"https://api.github.com/repos/aspnet/Docs/issues/1515","number":1515,"state":"open","locked":false,"title":"dotnet-watch tutorial","user":{"login":"victorhurdugaci","id":5921642,"avatar_url":"https://avatars.githubusercontent.com/u/5921642?v=3","gravatar_id":"","url":"https://api.github.com/users/victorhurdugaci","html_url":"https://github.com/victorhurdugaci","followers_url":"https://api.github.com/users/victorhurdugaci/followers","following_url":"https://api.github.com/users/victorhurdugaci/following{/other_user}","gists_url":"https://api.github.com/users/victorhurdugaci/gists{/gist_id}","starred_url":"https://api.github.com/users/victorhurdugaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victorhurdugaci/subscriptions","organizations_url":"https://api.github.com/users/victorhurdugaci/orgs","repos_url":"https://api.github.com/users/victorhurdugaci/repos","events_url":"https://api.github.com/users/victorhurdugaci/events{/privacy}","received_events_url":"https://api.github.com/users/victorhurdugaci/received_events","type":"User","site_admin":false},"body":"Fixes https://github.com/aspnet/Docs/issues/696\r\n\r\nA tutorial on using `dotnet watch`\r\n\r\nPlease review @Rick-Anderson @rachelappel @danroth27 ","created_at":"2016-06-24T22:31:02Z","updated_at":"2016-06-25T01:16:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9c9bb78311e00c331fc8ab7e53d326b2e21b0de","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Docs/pulls/1515/commits","review_comments_url":"https://api.github.com/repos/aspnet/Docs/pulls/1515/comments","review_comment_url":"https://api.github.com/repos/aspnet/Docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Docs/issues/1515/comments","statuses_url":"https://api.github.com/repos/aspnet/Docs/statuses/05c73187f8db71b7960171ddf60060b9d5f28a10","head":{"label":"aspnet:victorhu/dotnet-watch","ref":"victorhu/dotnet-watch","sha":"05c73187f8db71b7960171ddf60060b9d5f28a10","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":28239455,"name":"Docs","full_name":"aspnet/Docs","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Docs","description":"Documentation for ASP.NET Core","fork":false,"url":"https://api.github.com/repos/aspnet/Docs","forks_url":"https://api.github.com/repos/aspnet/Docs/forks","keys_url":"https://api.github.com/repos/aspnet/Docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Docs/teams","hooks_url":"https://api.github.com/repos/aspnet/Docs/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Docs/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Docs/events","assignees_url":"https://api.github.com/repos/aspnet/Docs/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Docs/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Docs/tags","blobs_url":"https://api.github.com/repos/aspnet/Docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Docs/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Docs/languages","stargazers_url":"https://api.github.com/repos/aspnet/Docs/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Docs/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Docs/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Docs/subscription","commits_url":"https://api.github.com/repos/aspnet/Docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Docs/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Docs/merges","archive_url":"https://api.github.com/repos/aspnet/Docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Docs/downloads","issues_url":"https://api.github.com/repos/aspnet/Docs/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Docs/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Docs/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Docs/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Docs/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/Docs/deployments","created_at":"2014-12-19T17:38:02Z","updated_at":"2016-06-22T10:13:53Z","pushed_at":"2016-06-25T01:10:22Z","git_url":"git://github.com/aspnet/Docs.git","ssh_url":"git@github.com:aspnet/Docs.git","clone_url":"https://github.com/aspnet/Docs.git","svn_url":"https://github.com/aspnet/Docs","homepage":"","size":54124,"stargazers_count":541,"watchers_count":541,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":937,"mirror_url":null,"open_issues_count":173,"forks":937,"open_issues":173,"watchers":541,"default_branch":"master"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"912787d661e491fddbd22c11dcd08e3abfc73416","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":28239455,"name":"Docs","full_name":"aspnet/Docs","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Docs","description":"Documentation for ASP.NET Core","fork":false,"url":"https://api.github.com/repos/aspnet/Docs","forks_url":"https://api.github.com/repos/aspnet/Docs/forks","keys_url":"https://api.github.com/repos/aspnet/Docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Docs/teams","hooks_url":"https://api.github.com/repos/aspnet/Docs/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Docs/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Docs/events","assignees_url":"https://api.github.com/repos/aspnet/Docs/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Docs/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Docs/tags","blobs_url":"https://api.github.com/repos/aspnet/Docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Docs/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Docs/languages","stargazers_url":"https://api.github.com/repos/aspnet/Docs/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Docs/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Docs/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Docs/subscription","commits_url":"https://api.github.com/repos/aspnet/Docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Docs/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Docs/merges","archive_url":"https://api.github.com/repos/aspnet/Docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Docs/downloads","issues_url":"https://api.github.com/repos/aspnet/Docs/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Docs/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Docs/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Docs/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Docs/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/Docs/deployments","created_at":"2014-12-19T17:38:02Z","updated_at":"2016-06-22T10:13:53Z","pushed_at":"2016-06-25T01:10:22Z","git_url":"git://github.com/aspnet/Docs.git","ssh_url":"git@github.com:aspnet/Docs.git","clone_url":"https://github.com/aspnet/Docs.git","svn_url":"https://github.com/aspnet/Docs","homepage":"","size":54124,"stargazers_count":541,"watchers_count":541,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":937,"mirror_url":null,"open_issues_count":173,"forks":937,"open_issues":173,"watchers":541,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/1515"},"html":{"href":"https://github.com/aspnet/Docs/pull/1515"},"issue":{"href":"https://api.github.com/repos/aspnet/Docs/issues/1515"},"comments":{"href":"https://api.github.com/repos/aspnet/Docs/issues/1515/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/1515/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Docs/pulls/1515/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Docs/statuses/05c73187f8db71b7960171ddf60060b9d5f28a10"}}}}
{"actor":{"display_login":"BrennanConroy"}}