{"action":"created","comment":{"url":"https://api.github.com/repos/cake-build/cake/pulls/comments/29836616","id":29836616,"diff_hunk":"@@ -109,9 +110,13 @@ private static AssemblyInfoRegistration GetRegistrations(AssemblyInfoSettings se\n             registration.AddString(\"AssemblyCopyright\", \"System.Reflection\", settings.Copyright);\n             registration.AddString(\"AssemblyTrademark\", \"System.Reflection\", settings.Trademark);\n             registration.AddString(\"Guid\", \"System.Runtime.InteropServices\", settings.Guid);\n+            foreach (var assemblyName in settings.InternalsVisibleTo ?? Enumerable.Empty<string>())","path":"src/Cake.Common/Solution/Project/Properties/AssemblyInfoCreator.cs","position":21,"original_position":21,"commit_id":"bc05a139111679da0b9a7f6f18496436a9d0e113","original_commit_id":"bc05a139111679da0b9a7f6f18496436a9d0e113","user":{"login":"patriksvensson","id":357872,"avatar_url":"https://avatars.githubusercontent.com/u/357872?v=3","gravatar_id":"","url":"https://api.github.com/users/patriksvensson","html_url":"https://github.com/patriksvensson","followers_url":"https://api.github.com/users/patriksvensson/followers","following_url":"https://api.github.com/users/patriksvensson/following{/other_user}","gists_url":"https://api.github.com/users/patriksvensson/gists{/gist_id}","starred_url":"https://api.github.com/users/patriksvensson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patriksvensson/subscriptions","organizations_url":"https://api.github.com/users/patriksvensson/orgs","repos_url":"https://api.github.com/users/patriksvensson/repos","events_url":"https://api.github.com/users/patriksvensson/events{/privacy}","received_events_url":"https://api.github.com/users/patriksvensson/received_events","type":"User","site_admin":false},"body":"I think it would be a good idea to not treat the InternalsVisibleTo as a registration.\r\n\r\nMaybe something like this in the `Create` method:\r\n\r\n```csharp\r\nusing (var stream = _fileSystem.GetFile(absoluteOutputPath).OpenWrite())\r\nusing (var writer = new StreamWriter(stream, System.Text.Encoding.UTF8))\r\n{\r\n    // Write header.\r\n    writer.WriteLine(\"//------------------------------------------------------------------------------\");\r\n    writer.WriteLine(\"// <auto-generated>\");\r\n    writer.WriteLine(\"//     This code was generated by Cake.\");\r\n    writer.WriteLine(\"// </auto-generated>\");\r\n    writer.WriteLine(\"//------------------------------------------------------------------------------\");\r\n\r\n    if (registration.Attributes.Count > 0)\r\n    {\r\n        // Write namespaces.\r\n        var namespaces = registration.Namespaces.Select(n => string.Concat(\"using \", n, \";\"));\r\n        if(settings.InternalsVisibleTo.Count > 0)\r\n        {\r\n            // Add namespace for InternalsVisibleTo to the set.\r\n            registration.Namespaces.Add(\"System.Runtime.CompilerServices\");\r\n        }\r\n        foreach (var @namespace in namespaces)\r\n        {\r\n            writer.WriteLine(@namespace);\r\n        }\r\n\r\n        writer.WriteLine();\r\n\r\n        // Write attributes.\r\n        foreach (var attribute in registration.Attributes)\r\n        {\r\n            writer.WriteLine(string.Concat(\"[assembly: \", attribute.Key, \"(\", attribute.Value, \")]\"));\r\n        }\r\n\r\n        // Write the internals visible to attributes.\r\n        if(settings.InternalsVisibleTo.Count > 0)\r\n        {\r\n            writer.WriteLine();\r\n\r\n            // Write attributes.\r\n            foreach (var attribute in settings.InternalsVisibleTo)\r\n            {\r\n                writer.WriteLine(string.Concat(\"[assembly: InternalsVisibleTo(\", attribute, \")]\"));\r\n            }\r\n        }        \r\n    }\r\n}\r\n```","created_at":"2015-05-07T09:26:34Z","updated_at":"2015-05-07T09:26:34Z","html_url":"https://github.com/cake-build/cake/pull/243#discussion_r29836616","pull_request_url":"https://api.github.com/repos/cake-build/cake/pulls/243","_links":{"self":{"href":"https://api.github.com/repos/cake-build/cake/pulls/comments/29836616"},"html":{"href":"https://github.com/cake-build/cake/pull/243#discussion_r29836616"},"pull_request":{"href":"https://api.github.com/repos/cake-build/cake/pulls/243"}}},"pull_request":{"url":"https://api.github.com/repos/cake-build/cake/pulls/243","id":34810646,"html_url":"https://github.com/cake-build/cake/pull/243","diff_url":"https://github.com/cake-build/cake/pull/243.diff","patch_url":"https://github.com/cake-build/cake/pull/243.patch","issue_url":"https://api.github.com/repos/cake-build/cake/issues/243","number":243,"state":"open","locked":false,"title":"Added support for InternalsVisibleTo attribute as per issue #240","user":{"login":"cgourlay","id":8118214,"avatar_url":"https://avatars.githubusercontent.com/u/8118214?v=3","gravatar_id":"","url":"https://api.github.com/users/cgourlay","html_url":"https://github.com/cgourlay","followers_url":"https://api.github.com/users/cgourlay/followers","following_url":"https://api.github.com/users/cgourlay/following{/other_user}","gists_url":"https://api.github.com/users/cgourlay/gists{/gist_id}","starred_url":"https://api.github.com/users/cgourlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgourlay/subscriptions","organizations_url":"https://api.github.com/users/cgourlay/orgs","repos_url":"https://api.github.com/users/cgourlay/repos","events_url":"https://api.github.com/users/cgourlay/events{/privacy}","received_events_url":"https://api.github.com/users/cgourlay/received_events","type":"User","site_admin":false},"body":"The existing implementation of the `GetRegistrations` method uses a Dictionary to manage the attributes to be added to the AssInfo.  I ran into problems where the InternalsVisibleTo attribute needs to be applied n times. Worked round this by using a `List<KeyValuePair<string,string>>`. However, this loses a couple of things: prevention of adding duplicate attributes and StringComparer.OrdinalIgnoreCase.\r\n\r\nWould appreciate feedback.\r\n\r\nCheers","created_at":"2015-05-06T12:18:22Z","updated_at":"2015-05-07T09:26:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c109c80aeaed4b1b9bfa35fa3cededc5e7f0aa34","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cake-build/cake/pulls/243/commits","review_comments_url":"https://api.github.com/repos/cake-build/cake/pulls/243/comments","review_comment_url":"https://api.github.com/repos/cake-build/cake/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cake-build/cake/issues/243/comments","statuses_url":"https://api.github.com/repos/cake-build/cake/statuses/bc05a139111679da0b9a7f6f18496436a9d0e113","head":{"label":"cgourlay:develop","ref":"develop","sha":"bc05a139111679da0b9a7f6f18496436a9d0e113","user":{"login":"cgourlay","id":8118214,"avatar_url":"https://avatars.githubusercontent.com/u/8118214?v=3","gravatar_id":"","url":"https://api.github.com/users/cgourlay","html_url":"https://github.com/cgourlay","followers_url":"https://api.github.com/users/cgourlay/followers","following_url":"https://api.github.com/users/cgourlay/following{/other_user}","gists_url":"https://api.github.com/users/cgourlay/gists{/gist_id}","starred_url":"https://api.github.com/users/cgourlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgourlay/subscriptions","organizations_url":"https://api.github.com/users/cgourlay/orgs","repos_url":"https://api.github.com/users/cgourlay/repos","events_url":"https://api.github.com/users/cgourlay/events{/privacy}","received_events_url":"https://api.github.com/users/cgourlay/received_events","type":"User","site_admin":false},"repo":{"id":34261854,"name":"cake","full_name":"cgourlay/cake","owner":{"login":"cgourlay","id":8118214,"avatar_url":"https://avatars.githubusercontent.com/u/8118214?v=3","gravatar_id":"","url":"https://api.github.com/users/cgourlay","html_url":"https://github.com/cgourlay","followers_url":"https://api.github.com/users/cgourlay/followers","following_url":"https://api.github.com/users/cgourlay/following{/other_user}","gists_url":"https://api.github.com/users/cgourlay/gists{/gist_id}","starred_url":"https://api.github.com/users/cgourlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgourlay/subscriptions","organizations_url":"https://api.github.com/users/cgourlay/orgs","repos_url":"https://api.github.com/users/cgourlay/repos","events_url":"https://api.github.com/users/cgourlay/events{/privacy}","received_events_url":"https://api.github.com/users/cgourlay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cgourlay/cake","description":"Cake (C# Make) is a build automation system.","fork":true,"url":"https://api.github.com/repos/cgourlay/cake","forks_url":"https://api.github.com/repos/cgourlay/cake/forks","keys_url":"https://api.github.com/repos/cgourlay/cake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cgourlay/cake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cgourlay/cake/teams","hooks_url":"https://api.github.com/repos/cgourlay/cake/hooks","issue_events_url":"https://api.github.com/repos/cgourlay/cake/issues/events{/number}","events_url":"https://api.github.com/repos/cgourlay/cake/events","assignees_url":"https://api.github.com/repos/cgourlay/cake/assignees{/user}","branches_url":"https://api.github.com/repos/cgourlay/cake/branches{/branch}","tags_url":"https://api.github.com/repos/cgourlay/cake/tags","blobs_url":"https://api.github.com/repos/cgourlay/cake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cgourlay/cake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cgourlay/cake/git/refs{/sha}","trees_url":"https://api.github.com/repos/cgourlay/cake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cgourlay/cake/statuses/{sha}","languages_url":"https://api.github.com/repos/cgourlay/cake/languages","stargazers_url":"https://api.github.com/repos/cgourlay/cake/stargazers","contributors_url":"https://api.github.com/repos/cgourlay/cake/contributors","subscribers_url":"https://api.github.com/repos/cgourlay/cake/subscribers","subscription_url":"https://api.github.com/repos/cgourlay/cake/subscription","commits_url":"https://api.github.com/repos/cgourlay/cake/commits{/sha}","git_commits_url":"https://api.github.com/repos/cgourlay/cake/git/commits{/sha}","comments_url":"https://api.github.com/repos/cgourlay/cake/comments{/number}","issue_comment_url":"https://api.github.com/repos/cgourlay/cake/issues/comments{/number}","contents_url":"https://api.github.com/repos/cgourlay/cake/contents/{+path}","compare_url":"https://api.github.com/repos/cgourlay/cake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cgourlay/cake/merges","archive_url":"https://api.github.com/repos/cgourlay/cake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cgourlay/cake/downloads","issues_url":"https://api.github.com/repos/cgourlay/cake/issues{/number}","pulls_url":"https://api.github.com/repos/cgourlay/cake/pulls{/number}","milestones_url":"https://api.github.com/repos/cgourlay/cake/milestones{/number}","notifications_url":"https://api.github.com/repos/cgourlay/cake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cgourlay/cake/labels{/name}","releases_url":"https://api.github.com/repos/cgourlay/cake/releases{/id}","created_at":"2015-04-20T13:23:02Z","updated_at":"2015-05-06T12:09:06Z","pushed_at":"2015-05-06T12:09:06Z","git_url":"git://github.com/cgourlay/cake.git","ssh_url":"git@github.com:cgourlay/cake.git","clone_url":"https://github.com/cgourlay/cake.git","svn_url":"https://github.com/cgourlay/cake","homepage":"http://cakebuild.net/","size":2544,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"cake-build:develop","ref":"develop","sha":"1941ef60852fcec306f0f1bdfaf6bb842dbfbb25","user":{"login":"cake-build","id":7738262,"avatar_url":"https://avatars.githubusercontent.com/u/7738262?v=3","gravatar_id":"","url":"https://api.github.com/users/cake-build","html_url":"https://github.com/cake-build","followers_url":"https://api.github.com/users/cake-build/followers","following_url":"https://api.github.com/users/cake-build/following{/other_user}","gists_url":"https://api.github.com/users/cake-build/gists{/gist_id}","starred_url":"https://api.github.com/users/cake-build/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cake-build/subscriptions","organizations_url":"https://api.github.com/users/cake-build/orgs","repos_url":"https://api.github.com/users/cake-build/repos","events_url":"https://api.github.com/users/cake-build/events{/privacy}","received_events_url":"https://api.github.com/users/cake-build/received_events","type":"Organization","site_admin":false},"repo":{"id":20094029,"name":"cake","full_name":"cake-build/cake","owner":{"login":"cake-build","id":7738262,"avatar_url":"https://avatars.githubusercontent.com/u/7738262?v=3","gravatar_id":"","url":"https://api.github.com/users/cake-build","html_url":"https://github.com/cake-build","followers_url":"https://api.github.com/users/cake-build/followers","following_url":"https://api.github.com/users/cake-build/following{/other_user}","gists_url":"https://api.github.com/users/cake-build/gists{/gist_id}","starred_url":"https://api.github.com/users/cake-build/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cake-build/subscriptions","organizations_url":"https://api.github.com/users/cake-build/orgs","repos_url":"https://api.github.com/users/cake-build/repos","events_url":"https://api.github.com/users/cake-build/events{/privacy}","received_events_url":"https://api.github.com/users/cake-build/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cake-build/cake","description":"Cake (C# Make) is a build automation system.","fork":false,"url":"https://api.github.com/repos/cake-build/cake","forks_url":"https://api.github.com/repos/cake-build/cake/forks","keys_url":"https://api.github.com/repos/cake-build/cake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cake-build/cake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cake-build/cake/teams","hooks_url":"https://api.github.com/repos/cake-build/cake/hooks","issue_events_url":"https://api.github.com/repos/cake-build/cake/issues/events{/number}","events_url":"https://api.github.com/repos/cake-build/cake/events","assignees_url":"https://api.github.com/repos/cake-build/cake/assignees{/user}","branches_url":"https://api.github.com/repos/cake-build/cake/branches{/branch}","tags_url":"https://api.github.com/repos/cake-build/cake/tags","blobs_url":"https://api.github.com/repos/cake-build/cake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cake-build/cake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cake-build/cake/git/refs{/sha}","trees_url":"https://api.github.com/repos/cake-build/cake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cake-build/cake/statuses/{sha}","languages_url":"https://api.github.com/repos/cake-build/cake/languages","stargazers_url":"https://api.github.com/repos/cake-build/cake/stargazers","contributors_url":"https://api.github.com/repos/cake-build/cake/contributors","subscribers_url":"https://api.github.com/repos/cake-build/cake/subscribers","subscription_url":"https://api.github.com/repos/cake-build/cake/subscription","commits_url":"https://api.github.com/repos/cake-build/cake/commits{/sha}","git_commits_url":"https://api.github.com/repos/cake-build/cake/git/commits{/sha}","comments_url":"https://api.github.com/repos/cake-build/cake/comments{/number}","issue_comment_url":"https://api.github.com/repos/cake-build/cake/issues/comments{/number}","contents_url":"https://api.github.com/repos/cake-build/cake/contents/{+path}","compare_url":"https://api.github.com/repos/cake-build/cake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cake-build/cake/merges","archive_url":"https://api.github.com/repos/cake-build/cake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cake-build/cake/downloads","issues_url":"https://api.github.com/repos/cake-build/cake/issues{/number}","pulls_url":"https://api.github.com/repos/cake-build/cake/pulls{/number}","milestones_url":"https://api.github.com/repos/cake-build/cake/milestones{/number}","notifications_url":"https://api.github.com/repos/cake-build/cake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cake-build/cake/labels{/name}","releases_url":"https://api.github.com/repos/cake-build/cake/releases{/id}","created_at":"2014-05-23T09:26:54Z","updated_at":"2015-05-07T07:15:58Z","pushed_at":"2015-05-06T12:18:22Z","git_url":"git://github.com/cake-build/cake.git","ssh_url":"git@github.com:cake-build/cake.git","clone_url":"https://github.com/cake-build/cake.git","svn_url":"https://github.com/cake-build/cake","homepage":"http://cakebuild.net/","size":5812,"stargazers_count":155,"watchers_count":155,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":32,"forks":21,"open_issues":32,"watchers":155,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cake-build/cake/pulls/243"},"html":{"href":"https://github.com/cake-build/cake/pull/243"},"issue":{"href":"https://api.github.com/repos/cake-build/cake/issues/243"},"comments":{"href":"https://api.github.com/repos/cake-build/cake/issues/243/comments"},"review_comments":{"href":"https://api.github.com/repos/cake-build/cake/pulls/243/comments"},"review_comment":{"href":"https://api.github.com/repos/cake-build/cake/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cake-build/cake/pulls/243/commits"},"statuses":{"href":"https://api.github.com/repos/cake-build/cake/statuses/bc05a139111679da0b9a7f6f18496436a9d0e113"}}}}