{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/59521522","id":59521522,"diff_hunk":"@@ -0,0 +1,70 @@\n+﻿// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.\n+\n+using System;\n+using System.IO;\n+using System.Reflection;\n+using Xunit;\n+using Xunit.Abstractions;\n+using Xunit.Sdk;\n+\n+namespace Microsoft.VisualStudio\n+{\n+    // Resolves failed assembly resolves to assemblies that live alongside the dll that contains this test \n+    // framework.\n+    //\n+    // To avoid running into the .NET EventListener bug https://github.com/dotnet/roslyn/issues/6358, we\n+    // turn off AppDomain isolation in xUnit. Unfortunately, this changes binding behavior in two ways;\n+    // \n+    // 1) AppBase becomes the location of xunit.console.[arch].exe executable, instead of the test library.\n+    //\n+    // 2) Binding redirect and other binding settings are not respected because AppDomain 0 uses whatever\n+    //    settings are in xunit.console.[arch].exe.config.\n+    //\n+    // This is problematic for a variety of tests that expect this to work. For example, the project system \n+    // tests have an indirect reference on System.Collections.Immutable, 1.1.36 however, we only deploy \n+    // System.Collections.Immutable, 1.1.37, which, without a binding redirects, causes a version mismatch on\n+    // .NET Framework.\n+    //\n+    // The aim of this class is avoid the need of binding redirects, by always resolving to whatever assembly \n+    // is deployed alongside the test framework, we avoid the need\n+    public class ResolveDependenciesLocallyTestFramework : ITestFramework","path":"src/VisualStudio/ProjectSystem/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/ResolveDependenciesLocallyTestFramework.cs","position":30,"original_position":30,"commit_id":"dc20d7f04e8801a3a21ea07a546d46e51816a6da","original_commit_id":"dc20d7f04e8801a3a21ea07a546d46e51816a6da","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":"Do you guys have any native binaries that get deployed to the output folder? That's one of the things that breaks with this approach.","created_at":"2016-04-13T09:52:36Z","updated_at":"2016-04-13T09:52:36Z","html_url":"https://github.com/dotnet/roslyn/pull/9782#discussion_r59521522","pull_request_url":"https://api.github.com/repos/dotnet/roslyn/pulls/9782","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments/59521522"},"html":{"href":"https://github.com/dotnet/roslyn/pull/9782#discussion_r59521522"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/9782"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/9782","id":62999015,"html_url":"https://github.com/dotnet/roslyn/pull/9782","diff_url":"https://github.com/dotnet/roslyn/pull/9782.diff","patch_url":"https://github.com/dotnet/roslyn/pull/9782.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/9782","number":9782,"state":"closed","locked":false,"title":"Automatically resolve failed assembly resolves to alongside test library","user":{"login":"davkean","id":1103906,"avatar_url":"https://avatars.githubusercontent.com/u/1103906?v=3","gravatar_id":"","url":"https://api.github.com/users/davkean","html_url":"https://github.com/davkean","followers_url":"https://api.github.com/users/davkean/followers","following_url":"https://api.github.com/users/davkean/following{/other_user}","gists_url":"https://api.github.com/users/davkean/gists{/gist_id}","starred_url":"https://api.github.com/users/davkean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davkean/subscriptions","organizations_url":"https://api.github.com/users/davkean/orgs","repos_url":"https://api.github.com/users/davkean/repos","events_url":"https://api.github.com/users/davkean/events{/privacy}","received_events_url":"https://api.github.com/users/davkean/received_events","type":"User","site_admin":false},"body":"Fixes: #9490.\r\n\r\nResolves failed assembly resolves to assemblies that live alongside the dll that contains this test framework.\r\n\r\nTo avoid running into the.NET EventListener bug https://github.com/dotnet/roslyn/issues/6358, we turn off AppDomain isolation in xUnit.Unfortunately, this changes binding behavior in two ways;\r\n \r\n1) AppBase becomes the location of xunit.console.[arch].exe executable, instead of the test library.\r\n\r\n2) Binding redirect and other binding settings are not respected because AppDomain 0 uses whatever are in xunit.console.[arch].exe.config.\r\n\r\nThis is problematic for a variety of tests that expect this to work. For example, the project system    tests have an indirect reference on System.Collections.Immutable, 1.1.36 however, we only deploy    System.Collections.Immutable, 1.1.37, which, without a binding redirects, causes a version mismatch on .NET Framework.\r\n\r\nThis attempts to solve this by wrapping xunit's test framework to automatically hook onto AppDomain.AssemblyResolve for failed resolves and resolve to dlls locally. This is currently,\r\nhardened to only work for project system tests, but we should be able to long term make this work for all tests that need special binding or binding redirects to be in play even though they disable AppDomain in xunit.","created_at":"2016-03-16T00:37:51Z","updated_at":"2016-04-13T09:52:36Z","closed_at":"2016-03-16T04:27:54Z","merged_at":"2016-03-16T04:27:54Z","merge_commit_sha":"1ee9f1041c2bfb7870346f239678108bee5b92cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn/pulls/9782/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn/pulls/9782/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/9782/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/dc20d7f04e8801a3a21ea07a546d46e51816a6da","head":{"label":"davkean:ProjectSystemTests","ref":"ProjectSystemTests","sha":"dc20d7f04e8801a3a21ea07a546d46e51816a6da","user":{"login":"davkean","id":1103906,"avatar_url":"https://avatars.githubusercontent.com/u/1103906?v=3","gravatar_id":"","url":"https://api.github.com/users/davkean","html_url":"https://github.com/davkean","followers_url":"https://api.github.com/users/davkean/followers","following_url":"https://api.github.com/users/davkean/following{/other_user}","gists_url":"https://api.github.com/users/davkean/gists{/gist_id}","starred_url":"https://api.github.com/users/davkean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davkean/subscriptions","organizations_url":"https://api.github.com/users/davkean/orgs","repos_url":"https://api.github.com/users/davkean/repos","events_url":"https://api.github.com/users/davkean/events{/privacy}","received_events_url":"https://api.github.com/users/davkean/received_events","type":"User","site_admin":false},"repo":{"id":39850615,"name":"roslyn","full_name":"davkean/roslyn","owner":{"login":"davkean","id":1103906,"avatar_url":"https://avatars.githubusercontent.com/u/1103906?v=3","gravatar_id":"","url":"https://api.github.com/users/davkean","html_url":"https://github.com/davkean","followers_url":"https://api.github.com/users/davkean/followers","following_url":"https://api.github.com/users/davkean/following{/other_user}","gists_url":"https://api.github.com/users/davkean/gists{/gist_id}","starred_url":"https://api.github.com/users/davkean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davkean/subscriptions","organizations_url":"https://api.github.com/users/davkean/orgs","repos_url":"https://api.github.com/users/davkean/repos","events_url":"https://api.github.com/users/davkean/events{/privacy}","received_events_url":"https://api.github.com/users/davkean/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davkean/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":true,"url":"https://api.github.com/repos/davkean/roslyn","forks_url":"https://api.github.com/repos/davkean/roslyn/forks","keys_url":"https://api.github.com/repos/davkean/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davkean/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davkean/roslyn/teams","hooks_url":"https://api.github.com/repos/davkean/roslyn/hooks","issue_events_url":"https://api.github.com/repos/davkean/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/davkean/roslyn/events","assignees_url":"https://api.github.com/repos/davkean/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/davkean/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/davkean/roslyn/tags","blobs_url":"https://api.github.com/repos/davkean/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davkean/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davkean/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/davkean/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davkean/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/davkean/roslyn/languages","stargazers_url":"https://api.github.com/repos/davkean/roslyn/stargazers","contributors_url":"https://api.github.com/repos/davkean/roslyn/contributors","subscribers_url":"https://api.github.com/repos/davkean/roslyn/subscribers","subscription_url":"https://api.github.com/repos/davkean/roslyn/subscription","commits_url":"https://api.github.com/repos/davkean/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/davkean/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/davkean/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/davkean/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/davkean/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/davkean/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davkean/roslyn/merges","archive_url":"https://api.github.com/repos/davkean/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davkean/roslyn/downloads","issues_url":"https://api.github.com/repos/davkean/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/davkean/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/davkean/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/davkean/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davkean/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/davkean/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/davkean/roslyn/deployments","created_at":"2015-07-28T18:21:25Z","updated_at":"2016-02-09T06:55:36Z","pushed_at":"2016-04-12T19:46:00Z","git_url":"git://github.com/davkean/roslyn.git","ssh_url":"git@github.com:davkean/roslyn.git","clone_url":"https://github.com/davkean/roslyn.git","svn_url":"https://github.com/davkean/roslyn","homepage":"","size":153571,"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:future","ref":"future","sha":"acca2d95bede12284f009faabf7a6b9aaa7e971d","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":29078997,"name":"roslyn","full_name":"dotnet/roslyn","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/roslyn","description":"The .NET Compiler Platform (\"Roslyn\") provides open-source C# and Visual Basic compilers with rich code analysis APIs.","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn","forks_url":"https://api.github.com/repos/dotnet/roslyn/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn/deployments","created_at":"2015-01-11T02:39:03Z","updated_at":"2016-04-13T08:47:09Z","pushed_at":"2016-04-13T03:20:02Z","git_url":"git://github.com/dotnet/roslyn.git","ssh_url":"git@github.com:dotnet/roslyn.git","clone_url":"https://github.com/dotnet/roslyn.git","svn_url":"https://github.com/dotnet/roslyn","homepage":"","size":216122,"stargazers_count":4869,"watchers_count":4869,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1227,"mirror_url":null,"open_issues_count":2646,"forks":1227,"open_issues":2646,"watchers":4869,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/9782"},"html":{"href":"https://github.com/dotnet/roslyn/pull/9782"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/9782"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn/issues/9782/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/9782/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn/pulls/9782/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn/statuses/dc20d7f04e8801a3a21ea07a546d46e51816a6da"}}}}