You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MSTest's androidtest template does not work on CoreCLR Android because Assembly.Location returns an empty string, causing test discovery to fail with NotSupportedException.
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
Skip DotNetNewAndroidTest(CoreCLR) until MSTest fixes Assembly.Location
Make CoreCLR the default runtime for Debug builds (#11169)
[tests] Use MSTestPackageVersion in DotNetNewAndroidTest
[tests] Use MSTestPackageVersion in DotNetNewAndroidTest (dotnet#11209)