{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/docs/pulls/comments/199707733","pull_request_review_id":133861950,"id":199707733,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTcwNzczMw==","diff_hunk":"@@ -0,0 +1,110 @@\n+---\n+title: .NET Core version selection\n+description: Learn How .NET Core finds and chooses runtime versions for your program.\n+author: billwagner\n+ms.author: wiwagn\n+ms.date: 06/27/2018\n+---\n+# .NET Core version selection\n+\n+[!INCLUDE [topic-appliesto-net-core-2plus](../../../includes/topic-appliesto-net-core-2plus.md)]\n+\n+This article explains the policies used by the .NET Core tools, SDK, and runtime for selecting versions. These policies provide a balance between running applications using the specified versions and enabling ease of upgrading both developer and end user machines. These policies perform the following:\n+\n+- Easy and efficient deployment of .NET Core, including security and reliability updates.\n+- Usage of the latest tools and commands independent of target runtime.\n+\n+There are four activities during development and deployment where version selection occurs:\n+\n+- When you [run an SDK command](#the-sdk-uses-the-latest-installed-version).\n+- When you [build an assembly](target-framework-monikers-define-build-time-apis).\n+- When you [run a .NET Core application](framework-dependent-apps-roll-forward).\n+- When you publish a [self-contained application](self-contained-deployments-include-the-selected-runtime).\n+\n+The rest of this document examines those four scenarios.\n+\n+## The SDK uses the latest installed version\n+\n+SDK commands include `dotnet new`, `dotnet build` or `dotnet run`. The `dotnet` CLI must choose an SDK version for any command. The .NET Core CLI uses the latest SDK installed on the machine. You'll use the .NET Core SDK v2.1.301 when it's installed, even if the project you are working with targets the .NET Core Runtime 2.0. Note that this is true for preview versions as well as released versions. You can take advantage of the latest SDK features and improvements while targeting earlier .NET Core runtime versions. You can target multiple runtime versions of .NET Core on different projects, using the same SDK tools for all projects.\n+\n+On rare occasions, you may need to use a different version of the SDK. You specify that version in a [global.json file](../tools/global-json.md). The \"use latest\" policy means you only use `global.json` to specify a .NET Core version earlier than the latest installed version.\n+\n+`global.json` can be placed anywhere in the file hierarchy. The CLI searches upward from the project directory for the first `global.json` it finds. You control which projects a given `global.json` applies to by its place in the file system. The .NET CLI searches for a `global.json` file iteratively navigating the path upward from the current working directory. The first `global.json` file found specifies the version used. If that version is installed, that version is used. If the SDK specified in the global.json is not found, the .NET CLI rolls forward to the latest SDK installed. This is the same as the default behavior, when no global.json file is found.\n+\n+The following example shows the `global.json` syntax:\n+\n+``` json\n+{\n+  \"sdk\": {\n+    \"version\": \"2.0.0\"\n+  }\n+}\n+```\n+\n+The process for selecting an SDK version is:\n+\n+- `dotnet` searches for a `global.json` file iteratively reverse-navigating the path upward from the current working directory.\n+- `dotnet` uses the SDK specified in the first `global.json` found.\n+- `dotnet` binds to the latest installed SDK if no `global.json` is found.\n+\n+## Target Framework Monikers define build time APIs\n+\n+You build your project against APIs defined in a **Target Framework Moniker** (TFM). You specify the target framework in the project file. Set the `TargetFramework` element in your project file as shown in the following example:\n+\n+``` xml\n+<TargetFramework>netcoreapp2.0</TargetFramework>\n+```\n+\n+You may build your project against multiple TFMs. Setting multiple target frameworks is more common for libraries but can be done with applications as well. You specify a `TargetFrameworks` property (plural of `TargetFramework`). The target frameworks will be semicolon-delimited as shown in the following example:\n+\n+``` xml\n+<TargetFrameworks>netcoreapp2.0;net47</TargetFrameworks>\n+```\n+\n+A given SDK supports a fixed set of frameworks, capped to the target framework of the runtime it ships with. For example, the .NET Core 2.0 SDK includes the .NET Core 2.0 runtime, which is an implementation of the `netcoreapp2.0` target framework. The .NET Core 2.0 SDK will support `netcoreapp1.0`, `netcoreapp1.1`, and `netcoreapp2.0` but not `netcoreapp2.1` (or higher). You install the .NET Core 2.1 SDK to build for `netcoreapp2.1`\n+\n+.NET Standard target frameworks are also capped in the same way. The .NET Core 2.0 SDK is capped to `netstandard2.0`.\n+\n+## Framework-dependent apps roll forward\n+\n+You run an application from source with [`dotnet run`](../tools/dotnet-run.md). `dotnet run` both builds and runs an application. The `dotnet` executable is the **host** for the application.\n+\n+The host chooses the latest patch version installed on the machine. For example, if you specified `netcoreapp2.0` in your project file, and `2.0.4` is the latest .NET runtime installed, the `2.0.4` runtime is used.\n+\n+If no acceptable `2.0.*` version is found, a new `2.*` version is used. For example, if you specified `netcoreapp2.0` and only `2.1.0` is installed, the application runs using the `2.1.0` runtime. This behavior is referred to as \"minor version roll-forward.\" Lower versions also won't be considered. When no acceptable runtime is installed, the application will not run.\n+\n+A few usage examples demonstrate the behavior:\n+\n+- 2.0.4 is required. 2.0.5 is the highest patch version available. 2.0.5 is used.","path":"docs/core/versions/selection.md","position":78,"original_position":78,"commit_id":"4dd19d83f52bc088cb867cff6dc2e286bd25eeea","original_commit_id":"4dd19d83f52bc088cb867cff6dc2e286bd25eeea","user":{"login":"mairaw","id":12971179,"node_id":"MDQ6VXNlcjEyOTcxMTc5","avatar_url":"https://avatars2.githubusercontent.com/u/12971179?v=4","gravatar_id":"","url":"https://api.github.com/users/mairaw","html_url":"https://github.com/mairaw","followers_url":"https://api.github.com/users/mairaw/followers","following_url":"https://api.github.com/users/mairaw/following{/other_user}","gists_url":"https://api.github.com/users/mairaw/gists{/gist_id}","starred_url":"https://api.github.com/users/mairaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mairaw/subscriptions","organizations_url":"https://api.github.com/users/mairaw/orgs","repos_url":"https://api.github.com/users/mairaw/repos","events_url":"https://api.github.com/users/mairaw/events{/privacy}","received_events_url":"https://api.github.com/users/mairaw/received_events","type":"User","site_admin":false},"body":"available or installed?","created_at":"2018-07-03T07:29:30Z","updated_at":"2018-07-03T07:35:42Z","html_url":"https://github.com/dotnet/docs/pull/6060#discussion_r199707733","pull_request_url":"https://api.github.com/repos/dotnet/docs/pulls/6060","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/docs/pulls/comments/199707733"},"html":{"href":"https://github.com/dotnet/docs/pull/6060#discussion_r199707733"},"pull_request":{"href":"https://api.github.com/repos/dotnet/docs/pulls/6060"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/docs/pulls/6060","id":196265992,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MjY1OTky","html_url":"https://github.com/dotnet/docs/pull/6060","diff_url":"https://github.com/dotnet/docs/pull/6060.diff","patch_url":"https://github.com/dotnet/docs/pull/6060.patch","issue_url":"https://api.github.com/repos/dotnet/docs/issues/6060","number":6060,"state":"open","locked":false,"title":"Document .Net core version binding","user":{"login":"BillWagner","id":493969,"node_id":"MDQ6VXNlcjQ5Mzk2OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/493969?v=4","gravatar_id":"","url":"https://api.github.com/users/BillWagner","html_url":"https://github.com/BillWagner","followers_url":"https://api.github.com/users/BillWagner/followers","following_url":"https://api.github.com/users/BillWagner/following{/other_user}","gists_url":"https://api.github.com/users/BillWagner/gists{/gist_id}","starred_url":"https://api.github.com/users/BillWagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BillWagner/subscriptions","organizations_url":"https://api.github.com/users/BillWagner/orgs","repos_url":"https://api.github.com/users/BillWagner/repos","events_url":"https://api.github.com/users/BillWagner/events{/privacy}","received_events_url":"https://api.github.com/users/BillWagner/received_events","type":"User","site_admin":false},"body":"Fixed #2880 \r\n\r\nThe first commit adds the design document without changes. The second and third commit represent edits from spec to docs.\r\n","created_at":"2018-06-20T20:40:54Z","updated_at":"2018-07-03T07:35:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c831ad8aaae35953e038dc0d93755a4a8807352","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":867544075,"node_id":"MDU6TGFiZWw4Njc1NDQwNzU=","url":"https://api.github.com/repos/dotnet/docs/labels/changes-addressed","name":"changes-addressed","color":"f9d0c4","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/docs/pulls/6060/commits","review_comments_url":"https://api.github.com/repos/dotnet/docs/pulls/6060/comments","review_comment_url":"https://api.github.com/repos/dotnet/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/docs/issues/6060/comments","statuses_url":"https://api.github.com/repos/dotnet/docs/statuses/4dd19d83f52bc088cb867cff6dc2e286bd25eeea","head":{"label":"BillWagner:netcore-version-binding","ref":"netcore-version-binding","sha":"4dd19d83f52bc088cb867cff6dc2e286bd25eeea","user":{"login":"BillWagner","id":493969,"node_id":"MDQ6VXNlcjQ5Mzk2OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/493969?v=4","gravatar_id":"","url":"https://api.github.com/users/BillWagner","html_url":"https://github.com/BillWagner","followers_url":"https://api.github.com/users/BillWagner/followers","following_url":"https://api.github.com/users/BillWagner/following{/other_user}","gists_url":"https://api.github.com/users/BillWagner/gists{/gist_id}","starred_url":"https://api.github.com/users/BillWagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BillWagner/subscriptions","organizations_url":"https://api.github.com/users/BillWagner/orgs","repos_url":"https://api.github.com/users/BillWagner/repos","events_url":"https://api.github.com/users/BillWagner/events{/privacy}","received_events_url":"https://api.github.com/users/BillWagner/received_events","type":"User","site_admin":false},"repo":{"id":127573416,"node_id":"MDEwOlJlcG9zaXRvcnkxMjc1NzM0MTY=","name":"docs","full_name":"BillWagner/docs","owner":{"login":"BillWagner","id":493969,"node_id":"MDQ6VXNlcjQ5Mzk2OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/493969?v=4","gravatar_id":"","url":"https://api.github.com/users/BillWagner","html_url":"https://github.com/BillWagner","followers_url":"https://api.github.com/users/BillWagner/followers","following_url":"https://api.github.com/users/BillWagner/following{/other_user}","gists_url":"https://api.github.com/users/BillWagner/gists{/gist_id}","starred_url":"https://api.github.com/users/BillWagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BillWagner/subscriptions","organizations_url":"https://api.github.com/users/BillWagner/orgs","repos_url":"https://api.github.com/users/BillWagner/repos","events_url":"https://api.github.com/users/BillWagner/events{/privacy}","received_events_url":"https://api.github.com/users/BillWagner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BillWagner/docs","description":"This repository contains .NET Documentation.","fork":true,"url":"https://api.github.com/repos/BillWagner/docs","forks_url":"https://api.github.com/repos/BillWagner/docs/forks","keys_url":"https://api.github.com/repos/BillWagner/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BillWagner/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BillWagner/docs/teams","hooks_url":"https://api.github.com/repos/BillWagner/docs/hooks","issue_events_url":"https://api.github.com/repos/BillWagner/docs/issues/events{/number}","events_url":"https://api.github.com/repos/BillWagner/docs/events","assignees_url":"https://api.github.com/repos/BillWagner/docs/assignees{/user}","branches_url":"https://api.github.com/repos/BillWagner/docs/branches{/branch}","tags_url":"https://api.github.com/repos/BillWagner/docs/tags","blobs_url":"https://api.github.com/repos/BillWagner/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BillWagner/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BillWagner/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/BillWagner/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BillWagner/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/BillWagner/docs/languages","stargazers_url":"https://api.github.com/repos/BillWagner/docs/stargazers","contributors_url":"https://api.github.com/repos/BillWagner/docs/contributors","subscribers_url":"https://api.github.com/repos/BillWagner/docs/subscribers","subscription_url":"https://api.github.com/repos/BillWagner/docs/subscription","commits_url":"https://api.github.com/repos/BillWagner/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/BillWagner/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/BillWagner/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/BillWagner/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/BillWagner/docs/contents/{+path}","compare_url":"https://api.github.com/repos/BillWagner/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BillWagner/docs/merges","archive_url":"https://api.github.com/repos/BillWagner/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BillWagner/docs/downloads","issues_url":"https://api.github.com/repos/BillWagner/docs/issues{/number}","pulls_url":"https://api.github.com/repos/BillWagner/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/BillWagner/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/BillWagner/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BillWagner/docs/labels{/name}","releases_url":"https://api.github.com/repos/BillWagner/docs/releases{/id}","deployments_url":"https://api.github.com/repos/BillWagner/docs/deployments","created_at":"2018-03-31T21:38:54Z","updated_at":"2018-06-29T18:37:21Z","pushed_at":"2018-07-02T21:06:57Z","git_url":"git://github.com/BillWagner/docs.git","ssh_url":"git@github.com:BillWagner/docs.git","clone_url":"https://github.com/BillWagner/docs.git","svn_url":"https://github.com/BillWagner/docs","homepage":"https://docs.microsoft.com/dotnet","size":265293,"stargazers_count":0,"watchers_count":0,"language":"PowerShell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"bd76bb358e89fc78fe42d75ea52a1b51a09c9c16","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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":35890081,"node_id":"MDEwOlJlcG9zaXRvcnkzNTg5MDA4MQ==","name":"docs","full_name":"dotnet/docs","owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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/docs","description":"This repository contains .NET Documentation.","fork":false,"url":"https://api.github.com/repos/dotnet/docs","forks_url":"https://api.github.com/repos/dotnet/docs/forks","keys_url":"https://api.github.com/repos/dotnet/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/docs/teams","hooks_url":"https://api.github.com/repos/dotnet/docs/hooks","issue_events_url":"https://api.github.com/repos/dotnet/docs/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/docs/events","assignees_url":"https://api.github.com/repos/dotnet/docs/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/docs/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/docs/tags","blobs_url":"https://api.github.com/repos/dotnet/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/docs/languages","stargazers_url":"https://api.github.com/repos/dotnet/docs/stargazers","contributors_url":"https://api.github.com/repos/dotnet/docs/contributors","subscribers_url":"https://api.github.com/repos/dotnet/docs/subscribers","subscription_url":"https://api.github.com/repos/dotnet/docs/subscription","commits_url":"https://api.github.com/repos/dotnet/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/docs/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/docs/merges","archive_url":"https://api.github.com/repos/dotnet/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/docs/downloads","issues_url":"https://api.github.com/repos/dotnet/docs/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/docs/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/docs/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/docs/deployments","created_at":"2015-05-19T15:13:32Z","updated_at":"2018-07-03T06:43:44Z","pushed_at":"2018-07-03T07:22:32Z","git_url":"git://github.com/dotnet/docs.git","ssh_url":"git@github.com:dotnet/docs.git","clone_url":"https://github.com/dotnet/docs.git","svn_url":"https://github.com/dotnet/docs","homepage":"https://docs.microsoft.com/dotnet","size":528672,"stargazers_count":1159,"watchers_count":1159,"language":"PowerShell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2503,"mirror_url":null,"archived":false,"open_issues_count":695,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2503,"open_issues":695,"watchers":1159,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/docs/pulls/6060"},"html":{"href":"https://github.com/dotnet/docs/pull/6060"},"issue":{"href":"https://api.github.com/repos/dotnet/docs/issues/6060"},"comments":{"href":"https://api.github.com/repos/dotnet/docs/issues/6060/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/docs/pulls/6060/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/docs/pulls/6060/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/docs/statuses/4dd19d83f52bc088cb867cff6dc2e286bd25eeea"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mairaw"}}