{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/comments/58119712","id":58119712,"diff_hunk":"@@ -167,6 +179,50 @@ internal Task<TGrainObserverInterface> CreateObjectReference<TGrainObserverInter\n             return CreateObjectReferenceImpl<TGrainObserverInterface>(obj);\n         }\n \n+        private static void RegisterGrainTypes(Type grainInterfaceType)\n+        {\n+            // Do a one-time discovery of all the types used by this grain interface and if there is a serializer\n+            // for it, make sure the type is registered with the serialization manager.\n+            GrainRegistrationDictionary.GetOrAdd(\n+                grainInterfaceType,\n+                type =>\n+                {\n+                    if (type.IsConstructedGenericType)\n+                    {\n+                        foreach (var typeParam in type.GetGenericArguments().Where(SerializationManager.HasExternalSerializer))\n+                        {\n+                            SerializationManager.Register(typeParam);\n+                        }\n+                    }\n+\n+                    foreach (var paramType in \n+                        type.GetMethods(BindingFlags.Instance | BindingFlags.Public)\n+                        .SelectMany(\n+                            mi =>\n+                            {\n+                                var parameterTypes = mi.GetParameters().Select(pi => pi.ParameterType);\n+                                if (mi.ReturnType == typeof(void) || mi.ReturnType == typeof(Task))\n+                                {\n+                                    return parameterTypes;\n+                                }\n+\n+                                if (mi.ReturnType.IsGenericType && mi.ReturnType.GetGenericTypeDefinition() == typeof(Task<>))\n+                                {\n+                                    return parameterTypes.Concat(mi.ReturnType.GetGenericArguments());\n+                                }\n+\n+                                return parameterTypes.Concat(new[] { mi.ReturnType });\n+                            })\n+                        .Distinct()\n+                        .Where(SerializationManager.HasExternalSerializer))\n+                    {\n+                        SerializationManager.Register(paramType);","path":"src/Orleans/Core/GrainFactory.cs","position":null,"original_position":102,"commit_id":"23c44919e8558e8a93f36d67ac360338ade05c15","original_commit_id":"2156e542d18837915f9300e1d885aefae23a8ec4","user":{"login":"Carlm-MS","id":7471063,"avatar_url":"https://avatars.githubusercontent.com/u/7471063?v=3","gravatar_id":"","url":"https://api.github.com/users/Carlm-MS","html_url":"https://github.com/Carlm-MS","followers_url":"https://api.github.com/users/Carlm-MS/followers","following_url":"https://api.github.com/users/Carlm-MS/following{/other_user}","gists_url":"https://api.github.com/users/Carlm-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Carlm-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carlm-MS/subscriptions","organizations_url":"https://api.github.com/users/Carlm-MS/orgs","repos_url":"https://api.github.com/users/Carlm-MS/repos","events_url":"https://api.github.com/users/Carlm-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Carlm-MS/received_events","type":"User","site_admin":false},"body":"After more investigation, the Assembly Processor does a brute force scan of all assemblies that get loaded to find serialization info.  A minor change to that logic should be all that is necessary to fix this and handle the derived types issue as well.\r\n\r\nSorry for the churn.\r\n\r\n\r\n\r\nThe current mechanism is a bit verbose as well.\r\n","created_at":"2016-03-31T20:12:34Z","updated_at":"2016-03-31T20:12:34Z","html_url":"https://github.com/dotnet/orleans/pull/1618#discussion_r58119712","pull_request_url":"https://api.github.com/repos/dotnet/orleans/pulls/1618","_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments/58119712"},"html":{"href":"https://github.com/dotnet/orleans/pull/1618#discussion_r58119712"},"pull_request":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1618"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/1618","id":64287866,"html_url":"https://github.com/dotnet/orleans/pull/1618","diff_url":"https://github.com/dotnet/orleans/pull/1618.diff","patch_url":"https://github.com/dotnet/orleans/pull/1618.patch","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/1618","number":1618,"state":"open","locked":false,"title":"type registration for serializers","user":{"login":"Carlm-MS","id":7471063,"avatar_url":"https://avatars.githubusercontent.com/u/7471063?v=3","gravatar_id":"","url":"https://api.github.com/users/Carlm-MS","html_url":"https://github.com/Carlm-MS","followers_url":"https://api.github.com/users/Carlm-MS/followers","following_url":"https://api.github.com/users/Carlm-MS/following{/other_user}","gists_url":"https://api.github.com/users/Carlm-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Carlm-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carlm-MS/subscriptions","organizations_url":"https://api.github.com/users/Carlm-MS/orgs","repos_url":"https://api.github.com/users/Carlm-MS/repos","events_url":"https://api.github.com/users/Carlm-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Carlm-MS/received_events","type":"User","site_admin":false},"body":"- bug fix for powershell installer\r\n- scan types for use with external serializers","created_at":"2016-03-28T04:14:44Z","updated_at":"2016-03-31T20:12:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac59cfe93e3466e32e68a300cb58ff6db87376b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/orleans/pulls/1618/commits","review_comments_url":"https://api.github.com/repos/dotnet/orleans/pulls/1618/comments","review_comment_url":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/1618/comments","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/23c44919e8558e8a93f36d67ac360338ade05c15","head":{"label":"Carlm-MS:SerializerTypeRegistration","ref":"SerializerTypeRegistration","sha":"23c44919e8558e8a93f36d67ac360338ade05c15","user":{"login":"Carlm-MS","id":7471063,"avatar_url":"https://avatars.githubusercontent.com/u/7471063?v=3","gravatar_id":"","url":"https://api.github.com/users/Carlm-MS","html_url":"https://github.com/Carlm-MS","followers_url":"https://api.github.com/users/Carlm-MS/followers","following_url":"https://api.github.com/users/Carlm-MS/following{/other_user}","gists_url":"https://api.github.com/users/Carlm-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Carlm-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carlm-MS/subscriptions","organizations_url":"https://api.github.com/users/Carlm-MS/orgs","repos_url":"https://api.github.com/users/Carlm-MS/repos","events_url":"https://api.github.com/users/Carlm-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Carlm-MS/received_events","type":"User","site_admin":false},"repo":{"id":45006245,"name":"orleans","full_name":"Carlm-MS/orleans","owner":{"login":"Carlm-MS","id":7471063,"avatar_url":"https://avatars.githubusercontent.com/u/7471063?v=3","gravatar_id":"","url":"https://api.github.com/users/Carlm-MS","html_url":"https://github.com/Carlm-MS","followers_url":"https://api.github.com/users/Carlm-MS/followers","following_url":"https://api.github.com/users/Carlm-MS/following{/other_user}","gists_url":"https://api.github.com/users/Carlm-MS/gists{/gist_id}","starred_url":"https://api.github.com/users/Carlm-MS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carlm-MS/subscriptions","organizations_url":"https://api.github.com/users/Carlm-MS/orgs","repos_url":"https://api.github.com/users/Carlm-MS/repos","events_url":"https://api.github.com/users/Carlm-MS/events{/privacy}","received_events_url":"https://api.github.com/users/Carlm-MS/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Carlm-MS/orleans","description":"Orleans - Distributed Virtual Actor Model","fork":true,"url":"https://api.github.com/repos/Carlm-MS/orleans","forks_url":"https://api.github.com/repos/Carlm-MS/orleans/forks","keys_url":"https://api.github.com/repos/Carlm-MS/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Carlm-MS/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Carlm-MS/orleans/teams","hooks_url":"https://api.github.com/repos/Carlm-MS/orleans/hooks","issue_events_url":"https://api.github.com/repos/Carlm-MS/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/Carlm-MS/orleans/events","assignees_url":"https://api.github.com/repos/Carlm-MS/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/Carlm-MS/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/Carlm-MS/orleans/tags","blobs_url":"https://api.github.com/repos/Carlm-MS/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Carlm-MS/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Carlm-MS/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/Carlm-MS/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Carlm-MS/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/Carlm-MS/orleans/languages","stargazers_url":"https://api.github.com/repos/Carlm-MS/orleans/stargazers","contributors_url":"https://api.github.com/repos/Carlm-MS/orleans/contributors","subscribers_url":"https://api.github.com/repos/Carlm-MS/orleans/subscribers","subscription_url":"https://api.github.com/repos/Carlm-MS/orleans/subscription","commits_url":"https://api.github.com/repos/Carlm-MS/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/Carlm-MS/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/Carlm-MS/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/Carlm-MS/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/Carlm-MS/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/Carlm-MS/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Carlm-MS/orleans/merges","archive_url":"https://api.github.com/repos/Carlm-MS/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Carlm-MS/orleans/downloads","issues_url":"https://api.github.com/repos/Carlm-MS/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/Carlm-MS/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/Carlm-MS/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/Carlm-MS/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Carlm-MS/orleans/labels{/name}","releases_url":"https://api.github.com/repos/Carlm-MS/orleans/releases{/id}","deployments_url":"https://api.github.com/repos/Carlm-MS/orleans/deployments","created_at":"2015-10-27T00:16:59Z","updated_at":"2016-01-11T03:51:46Z","pushed_at":"2016-03-31T20:12:19Z","git_url":"git://github.com/Carlm-MS/orleans.git","ssh_url":"git@github.com:Carlm-MS/orleans.git","clone_url":"https://github.com/Carlm-MS/orleans.git","svn_url":"https://github.com/Carlm-MS/orleans","homepage":"http://dotnet.github.io/orleans","size":13340,"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":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"d1d638dd13eac9c9258de417d28945dd888794e3","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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":28232663,"name":"orleans","full_name":"dotnet/orleans","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","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/orleans","description":"Orleans - Distributed Virtual Actor Model","fork":false,"url":"https://api.github.com/repos/dotnet/orleans","forks_url":"https://api.github.com/repos/dotnet/orleans/forks","keys_url":"https://api.github.com/repos/dotnet/orleans/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/orleans/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/orleans/teams","hooks_url":"https://api.github.com/repos/dotnet/orleans/hooks","issue_events_url":"https://api.github.com/repos/dotnet/orleans/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/orleans/events","assignees_url":"https://api.github.com/repos/dotnet/orleans/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/orleans/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/orleans/tags","blobs_url":"https://api.github.com/repos/dotnet/orleans/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/orleans/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/orleans/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/orleans/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/orleans/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/orleans/languages","stargazers_url":"https://api.github.com/repos/dotnet/orleans/stargazers","contributors_url":"https://api.github.com/repos/dotnet/orleans/contributors","subscribers_url":"https://api.github.com/repos/dotnet/orleans/subscribers","subscription_url":"https://api.github.com/repos/dotnet/orleans/subscription","commits_url":"https://api.github.com/repos/dotnet/orleans/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/orleans/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/orleans/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/orleans/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/orleans/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/orleans/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/orleans/merges","archive_url":"https://api.github.com/repos/dotnet/orleans/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/orleans/downloads","issues_url":"https://api.github.com/repos/dotnet/orleans/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/orleans/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/orleans/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/orleans/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/orleans/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/orleans/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/orleans/deployments","created_at":"2014-12-19T14:32:50Z","updated_at":"2016-03-31T12:54:54Z","pushed_at":"2016-03-31T20:12:20Z","git_url":"git://github.com/dotnet/orleans.git","ssh_url":"git@github.com:dotnet/orleans.git","clone_url":"https://github.com/dotnet/orleans.git","svn_url":"https://github.com/dotnet/orleans","homepage":"http://dotnet.github.io/orleans","size":42673,"stargazers_count":1663,"watchers_count":1663,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":418,"mirror_url":null,"open_issues_count":184,"forks":418,"open_issues":184,"watchers":1663,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1618"},"html":{"href":"https://github.com/dotnet/orleans/pull/1618"},"issue":{"href":"https://api.github.com/repos/dotnet/orleans/issues/1618"},"comments":{"href":"https://api.github.com/repos/dotnet/orleans/issues/1618/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1618/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/1618/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/orleans/statuses/23c44919e8558e8a93f36d67ac360338ade05c15"}}}}