GitHub PullRequestReviewCommentEvent at 2014-05-17 00:56:27
Repository: ServiceMatrix
Actor: fsimonazzi
Payload: {"comment":{"url":"https://api.github.com/repos/Particular/ServiceMatrix/pulls/comments/12764887","id":12764887,"diff_hunk":"@@ -147,30 +142,32 @@ private void SetF5Experience()\n             this.DebuggerEvents.OnEnterRunMode += DebuggerEvents_OnEnterRunMode;\n         }\n \n-        void DebuggerEvents_OnEnterRunMode(EnvDTE.dbgEventReason Reason)\n+        private void DebuggerEvents_OnEnterRunMode(EnvDTE.dbgEventReason Reason)\n         {\n             if (String.IsNullOrEmpty(this.ServiceControlInstanceURI) ||\n                 Reason != EnvDTE.dbgEventReason.dbgEventReasonLaunchProgram)\n             {\n                 return;\n             }\n-            \n+\n             // Write DebugSessionId on Endpoints Bin folder\n             var debugSessionId = String.Format(\"{0}@{1}@{2}\", Environment.MachineName, this.InstanceName, DateTime.Now.ToUniversalTime().ToString(\"s\")).Replace(\" \", \"_\");\n             foreach (var endpoint in this.Design.Endpoints.GetAll())\n             {\n-                var binFolder = Path.Combine(Path.GetDirectoryName(endpoint.Project.PhysicalPath), \"Bin\");\n+                var activeConfiguration = endpoint.Project.As<EnvDTE.Project>().ConfigurationManager.ActiveConfiguration;\n+                var outputPath = activeConfiguration.Properties.Item(\"OutputPath\").Value.ToString();\n \n-                if (endpoint is INServiceBusHost)\n-                {\n-                    binFolder = Path.Combine(binFolder, \"Debug\");\n-                }\n+                var binFolder =\n+                    Path.IsPathRooted(outputPath)\n+                        ? outputPath\n+                        : Path.Combine(Path.GetDirectoryName(endpoint.Project.PhysicalPath), outputPath);\n \n-                try\n+                if (!Directory.Exists(binFolder))\n                 {\n-                    File.WriteAllText(Path.Combine(binFolder, \"ServiceControl.DebugSessionId.txt\"), debugSessionId);\n+                    Directory.CreateDirectory(binFolder);\n                 }\n-                catch { }\n+\n+                File.WriteAllText(Path.Combine(binFolder, \"ServiceControl.DebugSessionId.txt\"), debugSessionId);","path":"src/ServiceMatrix.Automation/Model/Application.cs","position":87,"original_position":87,"commit_id":"3a0ff052f6c769401692f5a3b63a173e58c79a59","original_commit_id":"3a0ff052f6c769401692f5a3b63a173e58c79a59","user":{"login":"fsimonazzi","id":1406470,"avatar_url":"https://avatars.githubusercontent.com/u/1406470?","gravatar_id":"dd3a574e03f0c8b611917b48023bd046","url":"https://api.github.com/users/fsimonazzi","html_url":"https://github.com/fsimonazzi","followers_url":"https://api.github.com/users/fsimonazzi/followers","following_url":"https://api.github.com/users/fsimonazzi/following{/other_user}","gists_url":"https://api.github.com/users/fsimonazzi/gists{/gist_id}","starred_url":"https://api.github.com/users/fsimonazzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsimonazzi/subscriptions","organizations_url":"https://api.github.com/users/fsimonazzi/orgs","repos_url":"https://api.github.com/users/fsimonazzi/repos","events_url":"https://api.github.com/users/fsimonazzi/events{/privacy}","received_events_url":"https://api.github.com/users/fsimonazzi/received_events","type":"User","site_admin":false},"body":"Are you positive about this? Documentation states that the file, not the contents, is overwritten, and in my experience a new file is created.","created_at":"2014-05-17T00:56:27Z","updated_at":"2014-05-17T00:56:27Z","html_url":"https://github.com/Particular/ServiceMatrix/pull/367#discussion_r12764887","pull_request_url":"https://api.github.com/repos/Particular/ServiceMatrix/pulls/367","_links":{"self":{"href":"https://api.github.com/repos/Particular/ServiceMatrix/pulls/comments/12764887"},"html":{"href":"https://github.com/Particular/ServiceMatrix/pull/367#discussion_r12764887"},"pull_request":{"href":"https://api.github.com/repos/Particular/ServiceMatrix/pulls/367"}}}}