Skip to content

Commit a502340

Browse files
authored
Fix assembly resolution with DeploymentItem (#3034)
1 parent 5d5c982 commit a502340

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Adapter/MSTestAdapter.PlatformServices/Services/TestSourceHost.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ public void SetupHost()
154154
// which is trigged by AppContainerUtilities.AttachEventToResolveWinmd method.
155155
EqtTrace.SetupRemoteEqtTraceListeners(AppDomain);
156156

157+
// Force loading Microsoft.TestPlatform.CoreUtilities in the new app domain to ensure there is no assembly resolution issue.
158+
// For unknown reasons, with MSTest 3.4+ we start to see infinite cycles of assembly resolution of this dll in the new app
159+
// domain. In older versions, this was not the case, and the callback was allowing to fully lookup and load the dll before
160+
// triggering the next resolution.
161+
AppDomain.Load(typeof(EqtTrace).Assembly.GetName());
162+
157163
// Add an assembly resolver in the child app-domain...
158164
Type assemblyResolverType = typeof(AssemblyResolver);
159165

0 commit comments

Comments
 (0)