{"action":"created","comment":{"url":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/comments/42834430","id":42834430,"diff_hunk":"@@ -18,32 +18,81 @@ namespace NuGet.Packaging\n     public class PackagesConfigWriter : IDisposable\n     {\n         private readonly Stream _stream;\n+        private readonly string _filePath;\n         private bool _disposed;\n-        private bool _closed;\n         private NuGetVersion _minClientVersion;\n         private IFrameworkNameProvider _frameworkMappings;\n         private XDocument _xDocument;\n \n         /// <summary>\n-        /// Create a packages.config writer\n+        /// Create a packages.config writer using file path\n+        /// </summary>\n+        /// <param name=\"fullPath\">The full path to write the XML packages.config file into, or load existing packages.config from</param>\n+        /// <param name=\"createNew\">Whether to create a new packages.config file, or load an existing one</param>\n+        public PackagesConfigWriter(string fullPath, bool createNew)\n+            : this(fullPath, createNew, DefaultFrameworkNameProvider.Instance)\n+        {\n+        }\n+\n+        /// <summary>\n+        /// Create a packages.config writer using file path\n+        /// </summary>\n+        /// <param name=\"fullPath\">The full path to write the XML packages.config file into, or load existing packages.config from</param>\n+        /// <param name=\"createNew\">Whether to create a new packages.config file, or load an existing one</param>\n+        /// <param name=\"frameworkMappings\">Framework mappings</param>\n+        public PackagesConfigWriter(string fullPath, bool createNew, IFrameworkNameProvider frameworkMappings)\n+        {\n+            _frameworkMappings = frameworkMappings;","path":"src/NuGet.Core/NuGet.Packaging/PackagesConfigWriter.cs","position":30,"original_position":30,"commit_id":"b13898b4efddbb3690850004b608f68ed499f886","original_commit_id":"b13898b4efddbb3690850004b608f68ed499f886","user":{"login":"yishaigalatzer","id":1238711,"avatar_url":"https://avatars.githubusercontent.com/u/1238711?v=3","gravatar_id":"","url":"https://api.github.com/users/yishaigalatzer","html_url":"https://github.com/yishaigalatzer","followers_url":"https://api.github.com/users/yishaigalatzer/followers","following_url":"https://api.github.com/users/yishaigalatzer/following{/other_user}","gists_url":"https://api.github.com/users/yishaigalatzer/gists{/gist_id}","starred_url":"https://api.github.com/users/yishaigalatzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yishaigalatzer/subscriptions","organizations_url":"https://api.github.com/users/yishaigalatzer/orgs","repos_url":"https://api.github.com/users/yishaigalatzer/repos","events_url":"https://api.github.com/users/yishaigalatzer/events{/privacy}","received_events_url":"https://api.github.com/users/yishaigalatzer/received_events","type":"User","site_admin":false},"body":"nullchecks","created_at":"2015-10-23T05:35:23Z","updated_at":"2015-10-23T05:35:23Z","html_url":"https://github.com/NuGet/NuGet.Client/pull/49#discussion_r42834430","pull_request_url":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/comments/42834430"},"html":{"href":"https://github.com/NuGet/NuGet.Client/pull/49#discussion_r42834430"},"pull_request":{"href":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/49","id":48125723,"html_url":"https://github.com/NuGet/NuGet.Client/pull/49","diff_url":"https://github.com/NuGet/NuGet.Client/pull/49.diff","patch_url":"https://github.com/NuGet/NuGet.Client/pull/49.patch","issue_url":"https://api.github.com/repos/NuGet/NuGet.Client/issues/49","number":49,"state":"open","locked":false,"title":"Fixes https://github.com/NuGet/Home/issues/1566","user":{"login":"danliu","id":1087852,"avatar_url":"https://avatars.githubusercontent.com/u/1087852?v=3","gravatar_id":"","url":"https://api.github.com/users/danliu","html_url":"https://github.com/danliu","followers_url":"https://api.github.com/users/danliu/followers","following_url":"https://api.github.com/users/danliu/following{/other_user}","gists_url":"https://api.github.com/users/danliu/gists{/gist_id}","starred_url":"https://api.github.com/users/danliu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danliu/subscriptions","organizations_url":"https://api.github.com/users/danliu/orgs","repos_url":"https://api.github.com/users/danliu/repos","events_url":"https://api.github.com/users/danliu/events{/privacy}","received_events_url":"https://api.github.com/users/danliu/received_events","type":"User","site_admin":false},"body":"Fix the potential packages.config corrupt issue, by save XDocument to a temporary file and overwrite the original packages.config file (when it already exists).\r\n\r\n","created_at":"2015-10-19T21:00:39Z","updated_at":"2015-10-23T05:35:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bebf540fdb25f7a4f2dab2516719acc617c0b2fb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/49/commits","review_comments_url":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/49/comments","review_comment_url":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NuGet/NuGet.Client/issues/49/comments","statuses_url":"https://api.github.com/repos/NuGet/NuGet.Client/statuses/b13898b4efddbb3690850004b608f68ed499f886","head":{"label":"NuGet:fix1566","ref":"fix1566","sha":"b13898b4efddbb3690850004b608f68ed499f886","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":19330736,"name":"NuGet.Client","full_name":"NuGet/NuGet.Client","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGet.Client","description":"Core client libraries for NuGet Services","fork":false,"url":"https://api.github.com/repos/NuGet/NuGet.Client","forks_url":"https://api.github.com/repos/NuGet/NuGet.Client/forks","keys_url":"https://api.github.com/repos/NuGet/NuGet.Client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGet.Client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGet.Client/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGet.Client/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGet.Client/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGet.Client/events","assignees_url":"https://api.github.com/repos/NuGet/NuGet.Client/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGet.Client/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGet.Client/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGet.Client/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGet.Client/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGet.Client/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGet.Client/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGet.Client/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGet.Client/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGet.Client/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGet.Client/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGet.Client/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGet.Client/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGet.Client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGet.Client/merges","archive_url":"https://api.github.com/repos/NuGet/NuGet.Client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGet.Client/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGet.Client/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGet.Client/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGet.Client/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGet.Client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGet.Client/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGet.Client/releases{/id}","created_at":"2014-04-30T23:46:11Z","updated_at":"2015-10-14T13:47:33Z","pushed_at":"2015-10-23T05:21:31Z","git_url":"git://github.com/NuGet/NuGet.Client.git","ssh_url":"git@github.com:NuGet/NuGet.Client.git","clone_url":"https://github.com/NuGet/NuGet.Client.git","svn_url":"https://github.com/NuGet/NuGet.Client","homepage":null,"size":15697,"stargazers_count":6,"watchers_count":6,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":17,"forks":10,"open_issues":17,"watchers":6,"default_branch":"dev"}},"base":{"label":"NuGet:dev","ref":"dev","sha":"39c29240b5a249f6df0e46e106ba8ca65199f7b0","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":19330736,"name":"NuGet.Client","full_name":"NuGet/NuGet.Client","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGet.Client","description":"Core client libraries for NuGet Services","fork":false,"url":"https://api.github.com/repos/NuGet/NuGet.Client","forks_url":"https://api.github.com/repos/NuGet/NuGet.Client/forks","keys_url":"https://api.github.com/repos/NuGet/NuGet.Client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGet.Client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGet.Client/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGet.Client/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGet.Client/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGet.Client/events","assignees_url":"https://api.github.com/repos/NuGet/NuGet.Client/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGet.Client/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGet.Client/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGet.Client/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGet.Client/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGet.Client/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGet.Client/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGet.Client/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGet.Client/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGet.Client/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGet.Client/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGet.Client/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGet.Client/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGet.Client/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGet.Client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGet.Client/merges","archive_url":"https://api.github.com/repos/NuGet/NuGet.Client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGet.Client/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGet.Client/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGet.Client/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGet.Client/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGet.Client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGet.Client/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGet.Client/releases{/id}","created_at":"2014-04-30T23:46:11Z","updated_at":"2015-10-14T13:47:33Z","pushed_at":"2015-10-23T05:21:31Z","git_url":"git://github.com/NuGet/NuGet.Client.git","ssh_url":"git@github.com:NuGet/NuGet.Client.git","clone_url":"https://github.com/NuGet/NuGet.Client.git","svn_url":"https://github.com/NuGet/NuGet.Client","homepage":null,"size":15697,"stargazers_count":6,"watchers_count":6,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":17,"forks":10,"open_issues":17,"watchers":6,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/49"},"html":{"href":"https://github.com/NuGet/NuGet.Client/pull/49"},"issue":{"href":"https://api.github.com/repos/NuGet/NuGet.Client/issues/49"},"comments":{"href":"https://api.github.com/repos/NuGet/NuGet.Client/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NuGet/NuGet.Client/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/NuGet/NuGet.Client/statuses/b13898b4efddbb3690850004b608f68ed499f886"}}}}