{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/comments/221784156","pull_request_review_id":160518621,"id":221784156,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTc4NDE1Ng==","diff_hunk":"@@ -281,6 +297,90 @@ namespace Configuration {\n     }\r\n }\r\n \r\n+function registerDebugConfigurationProvider(ctx: vscode.ExtensionContext): void {\r\n+    const configuration = vscode.workspace.getConfiguration('docker.debugging');\r\n+\r\n+    if (configuration.get('enabled', false)) {\r\n+        const fileSystemProvider = new LocalFileSystemProvider();\r\n+\r\n+        const processProvider = new ChildProcessProvider();\r\n+        const dockerClient = new CliDockerClient(processProvider);\r\n+        const osProvider = new LocalOSProvider();\r\n+\r\n+        const dockerOutputChannel = vscode.window.createOutputChannel('Docker');\r\n+\r\n+        ctx.subscriptions.push(dockerOutputChannel);\r\n+\r\n+        const dockerOutputManager = new DefaultOutputManager(dockerOutputChannel);\r\n+\r\n+        const dockerManager =\r\n+            new DefaultDockerManager(\r\n+                new DefaultAppStorageProvider(fileSystemProvider),\r\n+                new DefaultDebuggerClient(\r\n+                    new RemoteVsDbgClient(\r\n+                        dockerOutputManager,\r\n+                        fileSystemProvider,\r\n+                        ctx.globalState,\r\n+                        osProvider,\r\n+                        processProvider)),\r\n+                dockerClient,\r\n+                dockerOutputManager,\r\n+                fileSystemProvider,\r\n+                osProvider,\r\n+                processProvider,\r\n+                ctx.workspaceState);\r\n+\r\n+        ctx.subscriptions.push(\r\n+            vscode.debug.registerDebugConfigurationProvider(\r\n+                'docker-netcoreapp',\r\n+                new DockerDebugConfigurationProvider(\r\n+                    dockerManager,\r\n+                    fileSystemProvider,\r\n+                    osProvider,\r\n+                    new MsBuildNetCoreProjectProvider(\r\n+                        fileSystemProvider,\r\n+                        new CommandLineMSBuildClient(processProvider),\r\n+                        new OSTempFileProvider(\r\n+                            osProvider,\r\n+                            processProvider)),\r\n+                    async () => {\r\n+                        // NOTE: Debugging .NET Core in Docker containers requires the C# (i.e. .NET Core debugging) extension.\r\n+                        //       As Docker debugging is experimental, we don't want the extension as a whole to depend on it.\r\n+                        //       Hence, we only check for its existence if/when asked to debug .NET Core in Docker containers.\r\n+                        // TODO: Remove this check once debugging is enabled-by-default (and then add a package.json extension dependency).\r\n+                        const dependenciesSatisfied = vscode.extensions.getExtension('ms-vscode.csharp') !== undefined;\r\n+\r\n+                        if (!dependenciesSatisfied) {\r\n+                            const openExtensionInGallery: vscode.MessageItem = {\r\n+                                title: 'View extension in gallery'\r\n+                            };\r\n+\r\n+                            const result = await vscode.window.showErrorMessage(\r\n+                                'To debug .NET Core in Docker containers, install the C# extension for VS Code.',\r\n+                                openExtensionInGallery);\r\n+\r\n+                            if (result === openExtensionInGallery) {\r\n+                                const browserClient: BrowserClient = new OpnBrowserClient();\r\n+\r\n+                                browserClient.openBrowser('https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp');\r\n+                            }\r\n+                        }\r\n+\r\n+                        return dependenciesSatisfied;\r\n+                    })));\r\n+\r\n+        ctx.subscriptions.push(\r\n+            vscode.debug.onDidChangeActiveDebugSession(\r\n+                session => {\r\n+                    if (session === undefined) {\r","path":"dockerExtension.ts","position":null,"original_position":109,"commit_id":"169d6a7d205db5e0255c72c4cb028b4f094f6410","original_commit_id":"2146a5860065a6ab982ff80f3f50ef9fc5d01835","user":{"login":"philliphoff","id":6402946,"node_id":"MDQ6VXNlcjY0MDI5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/6402946?v=4","gravatar_id":"","url":"https://api.github.com/users/philliphoff","html_url":"https://github.com/philliphoff","followers_url":"https://api.github.com/users/philliphoff/followers","following_url":"https://api.github.com/users/philliphoff/following{/other_user}","gists_url":"https://api.github.com/users/philliphoff/gists{/gist_id}","starred_url":"https://api.github.com/users/philliphoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philliphoff/subscriptions","organizations_url":"https://api.github.com/users/philliphoff/orgs","repos_url":"https://api.github.com/users/philliphoff/repos","events_url":"https://api.github.com/users/philliphoff/events{/privacy}","received_events_url":"https://api.github.com/users/philliphoff/received_events","type":"User","site_admin":false},"body":"I ran into issues with `onDidTerminateDebugSession` when the VS Live Share extension was installed, as it may \"wrap\" other debug adaptors, even when not actively used.  In that case, the returned `type` is the Live Share adaptor.  It exposes the underlying adaptor type via a custom request, but when a session is terminated you cannot make custom requests.\r\n\r\nInstead, I add a \"session manager\" that's informed by my debug adaptor when debugging is about to start, at which time it starts listening to the termination event.  Then, on termination, it performs the necessary cleanup and stops listening for future events.  This should limit it the cleanup to running only when the user has attempted to debug within a Docker container, but no more than once per attempt.","created_at":"2018-10-01T23:07:25Z","updated_at":"2018-10-01T23:07:25Z","html_url":"https://github.com/Microsoft/vscode-docker/pull/500#discussion_r221784156","pull_request_url":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/500","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/comments/221784156"},"html":{"href":"https://github.com/Microsoft/vscode-docker/pull/500#discussion_r221784156"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/500"}},"in_reply_to_id":221085760},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/500","id":217085632,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MDg1NjMy","html_url":"https://github.com/Microsoft/vscode-docker/pull/500","diff_url":"https://github.com/Microsoft/vscode-docker/pull/500.diff","patch_url":"https://github.com/Microsoft/vscode-docker/pull/500.patch","issue_url":"https://api.github.com/repos/Microsoft/vscode-docker/issues/500","number":500,"state":"open","locked":false,"title":"Add debugging support for .NET Core in Docker containers","user":{"login":"philliphoff","id":6402946,"node_id":"MDQ6VXNlcjY0MDI5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/6402946?v=4","gravatar_id":"","url":"https://api.github.com/users/philliphoff","html_url":"https://github.com/philliphoff","followers_url":"https://api.github.com/users/philliphoff/followers","following_url":"https://api.github.com/users/philliphoff/following{/other_user}","gists_url":"https://api.github.com/users/philliphoff/gists{/gist_id}","starred_url":"https://api.github.com/users/philliphoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philliphoff/subscriptions","organizations_url":"https://api.github.com/users/philliphoff/orgs","repos_url":"https://api.github.com/users/philliphoff/repos","events_url":"https://api.github.com/users/philliphoff/events{/privacy}","received_events_url":"https://api.github.com/users/philliphoff/received_events","type":"User","site_admin":false},"body":"Adds support for debugging .NET Core applications within Docker containers, in a manner similar to that performed by Visual Studio's Docker-related tooling.\r\n\r\nThe basic feature set is:\r\n \r\n - Adds a palette command to scaffold a “Docker .NET Core” debug launch configuration.\r\n   - The intent of this configuration is to minimize input/configuration from/by the user; properties will all be inferred\r\n   - Optional properties can be used to override image tags, names, arguments, variables, etc.\r\n - Adds a debug configuration provider that:\r\n   - Pulls down the latest .NET Core debugger from the Cloud, as needed\r\n   - Generates a debuggable Docker image for the application (e.g. building just the first stage of the multi-stage Dockerfile)\r\n   - Runs the Docker image in a container, applying shared volumes as necessary to expose debugger/application to the container\r\n   - Dynamically generates a .NET Core debug launch configuration allowing VS Code to initiate and attach the debugger within the container\r\n   - Launches the browser to the running application via the container’s mapped ports\r\n   - Cleans up containers when debugging is done\r\n \r\n> NOTE: Only debugging of *Linux* containers is supported today (in VS Code running on either Mac or Windows).  We cannot debug *Windows* containers because the .NET Core debugger (`vsdbg`) is not supported on Windows containers, and VS Code cannot use `msvsmon` (used by Visual Studio in that scenario).\r\n\r\nThe feature is disabled by default, using the new `docker.debugging.enabled` setting.\r\n","created_at":"2018-09-20T19:44:50Z","updated_at":"2018-10-01T23:07:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc0db4cc3163f915702c73a9bd3478b5475e9fd9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/500/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/500/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vscode-docker/issues/500/comments","statuses_url":"https://api.github.com/repos/Microsoft/vscode-docker/statuses/169d6a7d205db5e0255c72c4cb028b4f094f6410","head":{"label":"philliphoff:philliphoff-netcoreapp-debugging","ref":"philliphoff-netcoreapp-debugging","sha":"169d6a7d205db5e0255c72c4cb028b4f094f6410","user":{"login":"philliphoff","id":6402946,"node_id":"MDQ6VXNlcjY0MDI5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/6402946?v=4","gravatar_id":"","url":"https://api.github.com/users/philliphoff","html_url":"https://github.com/philliphoff","followers_url":"https://api.github.com/users/philliphoff/followers","following_url":"https://api.github.com/users/philliphoff/following{/other_user}","gists_url":"https://api.github.com/users/philliphoff/gists{/gist_id}","starred_url":"https://api.github.com/users/philliphoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philliphoff/subscriptions","organizations_url":"https://api.github.com/users/philliphoff/orgs","repos_url":"https://api.github.com/users/philliphoff/repos","events_url":"https://api.github.com/users/philliphoff/events{/privacy}","received_events_url":"https://api.github.com/users/philliphoff/received_events","type":"User","site_admin":false},"repo":{"id":141176957,"node_id":"MDEwOlJlcG9zaXRvcnkxNDExNzY5NTc=","name":"vscode-docker","full_name":"philliphoff/vscode-docker","private":false,"owner":{"login":"philliphoff","id":6402946,"node_id":"MDQ6VXNlcjY0MDI5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/6402946?v=4","gravatar_id":"","url":"https://api.github.com/users/philliphoff","html_url":"https://github.com/philliphoff","followers_url":"https://api.github.com/users/philliphoff/followers","following_url":"https://api.github.com/users/philliphoff/following{/other_user}","gists_url":"https://api.github.com/users/philliphoff/gists{/gist_id}","starred_url":"https://api.github.com/users/philliphoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philliphoff/subscriptions","organizations_url":"https://api.github.com/users/philliphoff/orgs","repos_url":"https://api.github.com/users/philliphoff/repos","events_url":"https://api.github.com/users/philliphoff/events{/privacy}","received_events_url":"https://api.github.com/users/philliphoff/received_events","type":"User","site_admin":false},"html_url":"https://github.com/philliphoff/vscode-docker","description":"Docker extension for VS Code.","fork":true,"url":"https://api.github.com/repos/philliphoff/vscode-docker","forks_url":"https://api.github.com/repos/philliphoff/vscode-docker/forks","keys_url":"https://api.github.com/repos/philliphoff/vscode-docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/philliphoff/vscode-docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/philliphoff/vscode-docker/teams","hooks_url":"https://api.github.com/repos/philliphoff/vscode-docker/hooks","issue_events_url":"https://api.github.com/repos/philliphoff/vscode-docker/issues/events{/number}","events_url":"https://api.github.com/repos/philliphoff/vscode-docker/events","assignees_url":"https://api.github.com/repos/philliphoff/vscode-docker/assignees{/user}","branches_url":"https://api.github.com/repos/philliphoff/vscode-docker/branches{/branch}","tags_url":"https://api.github.com/repos/philliphoff/vscode-docker/tags","blobs_url":"https://api.github.com/repos/philliphoff/vscode-docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/philliphoff/vscode-docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/philliphoff/vscode-docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/philliphoff/vscode-docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/philliphoff/vscode-docker/statuses/{sha}","languages_url":"https://api.github.com/repos/philliphoff/vscode-docker/languages","stargazers_url":"https://api.github.com/repos/philliphoff/vscode-docker/stargazers","contributors_url":"https://api.github.com/repos/philliphoff/vscode-docker/contributors","subscribers_url":"https://api.github.com/repos/philliphoff/vscode-docker/subscribers","subscription_url":"https://api.github.com/repos/philliphoff/vscode-docker/subscription","commits_url":"https://api.github.com/repos/philliphoff/vscode-docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/philliphoff/vscode-docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/philliphoff/vscode-docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/philliphoff/vscode-docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/philliphoff/vscode-docker/contents/{+path}","compare_url":"https://api.github.com/repos/philliphoff/vscode-docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/philliphoff/vscode-docker/merges","archive_url":"https://api.github.com/repos/philliphoff/vscode-docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/philliphoff/vscode-docker/downloads","issues_url":"https://api.github.com/repos/philliphoff/vscode-docker/issues{/number}","pulls_url":"https://api.github.com/repos/philliphoff/vscode-docker/pulls{/number}","milestones_url":"https://api.github.com/repos/philliphoff/vscode-docker/milestones{/number}","notifications_url":"https://api.github.com/repos/philliphoff/vscode-docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/philliphoff/vscode-docker/labels{/name}","releases_url":"https://api.github.com/repos/philliphoff/vscode-docker/releases{/id}","deployments_url":"https://api.github.com/repos/philliphoff/vscode-docker/deployments","created_at":"2018-07-16T18:21:58Z","updated_at":"2018-09-20T19:22:23Z","pushed_at":"2018-10-01T21:52:23Z","git_url":"git://github.com/philliphoff/vscode-docker.git","ssh_url":"git@github.com:philliphoff/vscode-docker.git","clone_url":"https://github.com/philliphoff/vscode-docker.git","svn_url":"https://github.com/philliphoff/vscode-docker","homepage":null,"size":15853,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"b32c19ac288a54b8967e4fc0b001f71c7034ecbb","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":44415469,"node_id":"MDEwOlJlcG9zaXRvcnk0NDQxNTQ2OQ==","name":"vscode-docker","full_name":"Microsoft/vscode-docker","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/vscode-docker","description":"Docker extension for VS Code.","fork":false,"url":"https://api.github.com/repos/Microsoft/vscode-docker","forks_url":"https://api.github.com/repos/Microsoft/vscode-docker/forks","keys_url":"https://api.github.com/repos/Microsoft/vscode-docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vscode-docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vscode-docker/teams","hooks_url":"https://api.github.com/repos/Microsoft/vscode-docker/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vscode-docker/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vscode-docker/events","assignees_url":"https://api.github.com/repos/Microsoft/vscode-docker/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vscode-docker/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vscode-docker/tags","blobs_url":"https://api.github.com/repos/Microsoft/vscode-docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vscode-docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vscode-docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vscode-docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vscode-docker/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vscode-docker/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vscode-docker/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vscode-docker/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vscode-docker/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vscode-docker/subscription","commits_url":"https://api.github.com/repos/Microsoft/vscode-docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vscode-docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vscode-docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vscode-docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vscode-docker/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vscode-docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vscode-docker/merges","archive_url":"https://api.github.com/repos/Microsoft/vscode-docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vscode-docker/downloads","issues_url":"https://api.github.com/repos/Microsoft/vscode-docker/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vscode-docker/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vscode-docker/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vscode-docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vscode-docker/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vscode-docker/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/vscode-docker/deployments","created_at":"2015-10-16T23:14:09Z","updated_at":"2018-09-30T01:12:08Z","pushed_at":"2018-10-01T21:52:25Z","git_url":"git://github.com/Microsoft/vscode-docker.git","ssh_url":"git@github.com:Microsoft/vscode-docker.git","clone_url":"https://github.com/Microsoft/vscode-docker.git","svn_url":"https://github.com/Microsoft/vscode-docker","homepage":null,"size":15869,"stargazers_count":220,"watchers_count":220,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":93,"mirror_url":null,"archived":false,"open_issues_count":100,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":93,"open_issues":100,"watchers":220,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/500"},"html":{"href":"https://github.com/Microsoft/vscode-docker/pull/500"},"issue":{"href":"https://api.github.com/repos/Microsoft/vscode-docker/issues/500"},"comments":{"href":"https://api.github.com/repos/Microsoft/vscode-docker/issues/500/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/500/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vscode-docker/pulls/500/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vscode-docker/statuses/169d6a7d205db5e0255c72c4cb028b4f094f6410"}},"author_association":"NONE"}}
{"actor":{"display_login":"philliphoff"}}