{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/dnx/pulls/comments/37610830","id":37610830,"diff_hunk":"@@ -68,45 +69,95 @@ public IList<ISourceReference> GetSources()\n                                      .ToList();\n         }\n \n-        public Assembly Load(IAssemblyLoadContext loadContext)\n+        EmitResult EmitResourceAssembly(\n+            AssemblyName assemblyName,\n+            IEnumerable<ResourceDescriptor> resourceDescriptors,\n+            AfterCompileContext afterCompileContext)\n         {\n-            using (var pdbStream = new MemoryStream())\n-            using (var assemblyStream = new MemoryStream())\n-            {\n-                IList<ResourceDescription> resources = CompilationContext.Resources;\n+            var resources = resourceDescriptors\n+                .Select(res => new ResourceDescription(res.Name, res.StreamFactory, isPublic: true));\n \n-                Logger.TraceInformation(\"[{0}]: Emitting assembly for {1}\", GetType().Name, Name);\n+            var mainCompilation = afterCompileContext.Compilation;\n+            afterCompileContext.Compilation = CSharpCompilation.Create(\n+                assemblyName.Name,\n+                options: mainCompilation.Options);\n \n-                var sw = Stopwatch.StartNew();\n+            Logger.TraceInformation(\"[{0}]: Emitting assembly for {1}\", GetType().Name, Name);\n \n-                EmitResult emitResult = null;\n+            var sw = Stopwatch.StartNew();\n \n-                if (_supportsPdbGeneration.Value)\n-                {\n-                    emitResult = CompilationContext.Compilation.Emit(assemblyStream, pdbStream: pdbStream, manifestResources: resources);\n-                }\n-                else\n-                {\n-                    Logger.TraceWarning(\"PDB generation is not supported on this platform\");\n-                    emitResult = CompilationContext.Compilation.Emit(assemblyStream, manifestResources: resources);\n-                }\n+            var emitResult = afterCompileContext.Compilation.Emit(\n+                    afterCompileContext.AssemblyStream,\n+                    manifestResources: resources);\n \n-                sw.Stop();\n+            sw.Stop();\n \n-                Logger.TraceInformation(\"[{0}]: Emitted {1} in {2}ms\", GetType().Name, Name, sw.ElapsedMilliseconds);\n+            Logger.TraceInformation(\"[{0}]: Emitted {1} in {2}ms\", GetType().Name, Name, sw.ElapsedMilliseconds);\n \n-                var diagnostics = CompilationContext.Diagnostics.Concat(\n-                    emitResult.Diagnostics);\n+            afterCompileContext.Diagnostics = CompilationContext.Diagnostics\n+                .Concat(emitResult.Diagnostics)\n+                .ToList();\n \n+            return emitResult;\n+        }\n+\n+        public Assembly Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext)","path":"src/Microsoft.Dnx.Compilation.CSharp/RoslynProjectReference.cs","position":65,"original_position":65,"commit_id":"7de7ff39af32a932ddf313eacf9166dbc9cc039a","original_commit_id":"7de7ff39af32a932ddf313eacf9166dbc9cc039a","user":{"login":"davidfowl","id":95136,"avatar_url":"https://avatars.githubusercontent.com/u/95136?v=3","gravatar_id":"","url":"https://api.github.com/users/davidfowl","html_url":"https://github.com/davidfowl","followers_url":"https://api.github.com/users/davidfowl/followers","following_url":"https://api.github.com/users/davidfowl/following{/other_user}","gists_url":"https://api.github.com/users/davidfowl/gists{/gist_id}","starred_url":"https://api.github.com/users/davidfowl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidfowl/subscriptions","organizations_url":"https://api.github.com/users/davidfowl/orgs","repos_url":"https://api.github.com/users/davidfowl/repos","events_url":"https://api.github.com/users/davidfowl/events{/privacy}","received_events_url":"https://api.github.com/users/davidfowl/received_events","type":"User","site_admin":false},"body":"So I'm thinking that we shouldn't call into ICompileModules for resource assemblies. I know it just another assembly but it feels like ICompileModules would just start to break (like ours) if we just started to call it multiple times when we have resource assemblies. Can you remove that piece?","created_at":"2015-08-21T07:06:51Z","updated_at":"2015-08-21T07:06:51Z","html_url":"https://github.com/aspnet/dnx/pull/2407#discussion_r37610830","pull_request_url":"https://api.github.com/repos/aspnet/dnx/pulls/2407","_links":{"self":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/comments/37610830"},"html":{"href":"https://github.com/aspnet/dnx/pull/2407#discussion_r37610830"},"pull_request":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/2407"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/dnx/pulls/2407","id":41615404,"html_url":"https://github.com/aspnet/dnx/pull/2407","diff_url":"https://github.com/aspnet/dnx/pull/2407.diff","patch_url":"https://github.com/aspnet/dnx/pull/2407.patch","issue_url":"https://api.github.com/repos/aspnet/dnx/issues/2407","number":2407,"state":"open","locked":false,"title":"Enable using resources with dnx","user":{"login":"kirthik","id":1267650,"avatar_url":"https://avatars.githubusercontent.com/u/1267650?v=3","gravatar_id":"","url":"https://api.github.com/users/kirthik","html_url":"https://github.com/kirthik","followers_url":"https://api.github.com/users/kirthik/followers","following_url":"https://api.github.com/users/kirthik/following{/other_user}","gists_url":"https://api.github.com/users/kirthik/gists{/gist_id}","starred_url":"https://api.github.com/users/kirthik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirthik/subscriptions","organizations_url":"https://api.github.com/users/kirthik/orgs","repos_url":"https://api.github.com/users/kirthik/repos","events_url":"https://api.github.com/users/kirthik/events{/privacy}","received_events_url":"https://api.github.com/users/kirthik/received_events","type":"User","site_admin":false},"body":"This PR enables following scenarios\r\n1. Creating .resources files \r\n2. Loading satellite assemblies and returning locale specific resource strings for resources in current projects, class libraries and nuget packages\r\n3. Copies satellite assemblies for dnu pack and dnu publish scenarios","created_at":"2015-08-04T20:46:18Z","updated_at":"2015-08-21T07:06:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4335dbb488141ba62b3383a5b9e4bf19ead2f65f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/dnx/pulls/2407/commits","review_comments_url":"https://api.github.com/repos/aspnet/dnx/pulls/2407/comments","review_comment_url":"https://api.github.com/repos/aspnet/dnx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/dnx/issues/2407/comments","statuses_url":"https://api.github.com/repos/aspnet/dnx/statuses/7de7ff39af32a932ddf313eacf9166dbc9cc039a","head":{"label":"aspnet:nugetresx","ref":"nugetresx","sha":"7de7ff39af32a932ddf313eacf9166dbc9cc039a","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":14225208,"name":"dnx","full_name":"aspnet/dnx","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/dnx","description":"The DNX (a .NET Execution Environment) contains the code required to bootstrap and run an application, including the compilation system, SDK tools, and the native CLR hosts.","fork":false,"url":"https://api.github.com/repos/aspnet/dnx","forks_url":"https://api.github.com/repos/aspnet/dnx/forks","keys_url":"https://api.github.com/repos/aspnet/dnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/dnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/dnx/teams","hooks_url":"https://api.github.com/repos/aspnet/dnx/hooks","issue_events_url":"https://api.github.com/repos/aspnet/dnx/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/dnx/events","assignees_url":"https://api.github.com/repos/aspnet/dnx/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/dnx/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/dnx/tags","blobs_url":"https://api.github.com/repos/aspnet/dnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/dnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/dnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/dnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/dnx/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/dnx/languages","stargazers_url":"https://api.github.com/repos/aspnet/dnx/stargazers","contributors_url":"https://api.github.com/repos/aspnet/dnx/contributors","subscribers_url":"https://api.github.com/repos/aspnet/dnx/subscribers","subscription_url":"https://api.github.com/repos/aspnet/dnx/subscription","commits_url":"https://api.github.com/repos/aspnet/dnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/dnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/dnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/dnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/dnx/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/dnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/dnx/merges","archive_url":"https://api.github.com/repos/aspnet/dnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/dnx/downloads","issues_url":"https://api.github.com/repos/aspnet/dnx/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/dnx/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/dnx/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/dnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/dnx/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/dnx/releases{/id}","created_at":"2013-11-08T06:01:29Z","updated_at":"2015-08-20T21:42:42Z","pushed_at":"2015-08-21T03:54:15Z","git_url":"git://github.com/aspnet/dnx.git","ssh_url":"git@github.com:aspnet/dnx.git","clone_url":"https://github.com/aspnet/dnx.git","svn_url":"https://github.com/aspnet/dnx","homepage":"","size":55065,"stargazers_count":848,"watchers_count":848,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":202,"mirror_url":null,"open_issues_count":376,"forks":202,"open_issues":376,"watchers":848,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"40829cb23a545a4a6e60554aa0b56fe72b446d79","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":14225208,"name":"dnx","full_name":"aspnet/dnx","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/dnx","description":"The DNX (a .NET Execution Environment) contains the code required to bootstrap and run an application, including the compilation system, SDK tools, and the native CLR hosts.","fork":false,"url":"https://api.github.com/repos/aspnet/dnx","forks_url":"https://api.github.com/repos/aspnet/dnx/forks","keys_url":"https://api.github.com/repos/aspnet/dnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/dnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/dnx/teams","hooks_url":"https://api.github.com/repos/aspnet/dnx/hooks","issue_events_url":"https://api.github.com/repos/aspnet/dnx/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/dnx/events","assignees_url":"https://api.github.com/repos/aspnet/dnx/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/dnx/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/dnx/tags","blobs_url":"https://api.github.com/repos/aspnet/dnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/dnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/dnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/dnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/dnx/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/dnx/languages","stargazers_url":"https://api.github.com/repos/aspnet/dnx/stargazers","contributors_url":"https://api.github.com/repos/aspnet/dnx/contributors","subscribers_url":"https://api.github.com/repos/aspnet/dnx/subscribers","subscription_url":"https://api.github.com/repos/aspnet/dnx/subscription","commits_url":"https://api.github.com/repos/aspnet/dnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/dnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/dnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/dnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/dnx/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/dnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/dnx/merges","archive_url":"https://api.github.com/repos/aspnet/dnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/dnx/downloads","issues_url":"https://api.github.com/repos/aspnet/dnx/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/dnx/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/dnx/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/dnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/dnx/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/dnx/releases{/id}","created_at":"2013-11-08T06:01:29Z","updated_at":"2015-08-20T21:42:42Z","pushed_at":"2015-08-21T03:54:15Z","git_url":"git://github.com/aspnet/dnx.git","ssh_url":"git@github.com:aspnet/dnx.git","clone_url":"https://github.com/aspnet/dnx.git","svn_url":"https://github.com/aspnet/dnx","homepage":"","size":55065,"stargazers_count":848,"watchers_count":848,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":202,"mirror_url":null,"open_issues_count":376,"forks":202,"open_issues":376,"watchers":848,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/2407"},"html":{"href":"https://github.com/aspnet/dnx/pull/2407"},"issue":{"href":"https://api.github.com/repos/aspnet/dnx/issues/2407"},"comments":{"href":"https://api.github.com/repos/aspnet/dnx/issues/2407/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/2407/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/dnx/pulls/2407/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/dnx/statuses/7de7ff39af32a932ddf313eacf9166dbc9cc039a"}}}}