Skip to content

MSTest androidtest template fails on CoreCLR Android: Assembly.Location returns empty #11174

Closed

Description

@jonathanpeppers

Summary

MSTest's androidtest template does not work on CoreCLR Android because Assembly.Location returns an empty string, causing test discovery to fail with NotSupportedException.

Root Cause

The MSTest VSTest bridge (SynchronizedSingleSessionVSTestBridgedTestFramework.ExecuteRequestAsync) resolves test assembly paths via:

csharp string[] testAssemblyPaths = [.. _getTestAssemblies().Select(x => x.Location)];

On CoreCLR Android, assemblies are loaded from memory via bundle probes (assembly store), so Assembly.Location returns "". This causes MSTestDiscovererHelpers.AreValidSources() to fail because Path.GetExtension("") doesn't match .dll or .exe.

On MonoVM, mono_assembly_load_from_full receives the assembly name as a parameter, which Mono uses to populate Assembly.Location — so this works.

Error

From dotnet-run-output.log on CI:

INSTRUMENTATION_RESULT: error=System.NotSupportedException: Running tests in any of the provided sources is not supported for the selected platform
   at Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.MSTestDiscovererHelpers.InitializeDiscovery(...)
   in MSTestDiscovererHelpers.cs:line 27

Upstream

This is fundamentally an MSTest issue — they suppress the IL3000 warning for Assembly.Location but don't handle the empty-string case. A fix or workaround is needed in either:

  • microsoft/testfx: Don't rely on Assembly.Location in the VSTest bridge
  • dotnet/runtime: Populate Assembly.Location for bundle-loaded assemblies on Android CoreCLR

Activity

  1. added
    Area: CoreCLR
    on Apr 21, 2026
  2. added
    needs-triage
    on Apr 21, 2026
  3. locked and limited conversation to collaborators on May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: CoreCLRneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions