{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/comments/57816796","id":57816796,"diff_hunk":"@@ -2280,6 +2280,23 @@ private static void RegisterSerializationProviders(List<TypeInfo> providerTypes)\n                         logger.Error(ErrorCode.SerMgr_ErrorLoadingAssemblyTypes, \"Failed to create instance of type: \" + type.FullName, exception);\n                     }\n                 });\n+\n+            // for the outside runtime client, a type may not be registered in the serialization manager before attempting to deserialize\n+            // which ends up causing deserialization to fail.  to fix this, we need to register the type if it's supported by any serializer.\n+            Action<Assembly> registerAction = \n+                assembly =>\n+                {\n+                    foreach (var type in assembly.GetTypes().Where(\n+                        type => \n+                        (type.IsClass || type.IsValueType) && !type.IsAbstract &&\n+                        externalSerializers.Any(ser => ser.IsSupportedType(type))))\n+                    {\n+                        SerializationManager.Register(type);\n+                    }\n+                };\n+\n+            AppDomain.CurrentDomain.AssemblyLoad += (o, e) => registerAction(e.LoadedAssembly);\n+            Array.ForEach(AppDomain.CurrentDomain.GetAssemblies(), registerAction);","path":"src/Orleans/Serialization/SerializationManager.cs","position":20,"original_position":20,"commit_id":"262885f12a82a58a28034ca3fd27222b5a4f4c76","original_commit_id":"262885f12a82a58a28034ca3fd27222b5a4f4c76","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":"@jdom Actually, a less brute force mechanism would be to scan all assemblies for grain interfaces and then find all method parameters/return value types.  Then register those. \r\n\r\nCan you think of any issues with that approach?","created_at":"2016-03-29T23:18:00Z","updated_at":"2016-03-29T23:18:00Z","html_url":"https://github.com/dotnet/orleans/pull/1618#discussion_r57816796","pull_request_url":"https://api.github.com/repos/dotnet/orleans/pulls/1618","_links":{"self":{"href":"https://api.github.com/repos/dotnet/orleans/pulls/comments/57816796"},"html":{"href":"https://github.com/dotnet/orleans/pull/1618#discussion_r57816796"},"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-29T23:18:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"219ed1447849c4f90ed3d333d3d8dc8f541c2f54","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/262885f12a82a58a28034ca3fd27222b5a4f4c76","head":{"label":"Carlm-MS:SerializerTypeRegistration","ref":"SerializerTypeRegistration","sha":"262885f12a82a58a28034ca3fd27222b5a4f4c76","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-28T04:13:02Z","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":13325,"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":"eb2f9c09766e6923056247cdcacd9456205cd3d8","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-29T15:56:10Z","pushed_at":"2016-03-28T21:34:27Z","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":42577,"stargazers_count":1652,"watchers_count":1652,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":417,"mirror_url":null,"open_issues_count":178,"forks":417,"open_issues":178,"watchers":1652,"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/262885f12a82a58a28034ca3fd27222b5a4f4c76"}}}}