Skip to content

Commit 507b734

Browse files
authored
Fix assembly resolution error (#1670)
1 parent 3bd8304 commit 507b734

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Adapter/MSTestAdapter.PlatformServices/Utilities/AssemblyUtility.cs

+11
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,17 @@ internal virtual string[] GetFullPathToDependentAssemblies(string assemblyPath,
215215
AppDomain? appDomain = null;
216216
try
217217
{
218+
// Force loading the resource assembly into the current domain so that we can get the resource strings even
219+
// when the custom assembly resolver kicks in.
220+
// This should not be required based on the algorithm followed during the satellite assembly resolution
221+
// https://learn.microsoft.com/dotnet/core/extensions/package-and-deploy-resources#net-framework-resource-fallback-process
222+
// BUT for some unknown reason the point 10 is not working as explained.
223+
// Satellite resolution should fallback to the NeutralResourcesLanguageAttribute that we set to en but don't
224+
// resulting in a FileNotFoundException.
225+
// See https://github.com/microsoft/testfx/issues/1598 for the error and https://github.com/microsoft/vstest/pull/4150
226+
// for the idea of the fix.
227+
_ = string.Format(CultureInfo.InvariantCulture, Resource.CannotFindFile, string.Empty);
228+
218229
appDomain = AppDomain.CreateDomain("Dependency finder domain", null, setupInfo);
219230
if (EqtTrace.IsInfoEnabled)
220231
{

0 commit comments

Comments
 (0)