dotnet/maui · error · Exception
No application was found in the specified directories.
Error message
No application was found in the specified directories.
What it means
Thrown by GetTestApplications after exhausting all search locations: the bin directory, FindAppsInDirectory, and SearchInArtifacts (which checks project-mapped artifact directories for config/tfm/rid). If none yield any application file, the build cannot find a deployable app to test.
Source
Thrown at eng/devices/devices-shared.cake:74
Information($"No universal binary found, checking RID-specific directory: {binDir}");
applications = FindAppsInDirectory(binDir);
}
}
else
{
applications = FindAppsInDirectory(binDir);
}
}
// If no applications found, check in specific artifact directories
if (!applications.Any())
{
applications = SearchInArtifacts(binDir, project, config, tfm, rid, isAndroid, artifactsDir);
}
if (!applications.Any())
{
throw new Exception($"No application was found in the specified directories.");
}
return applications;
}
IEnumerable<string> SearchInArtifacts(DirectoryPath originalBinDir, string project, string config, string tfm, string rid, bool isAndroid, string artifactsDir)
{
foreach (var entry in projectMappings)
{
if (project.Contains(entry.Key))
{
var binDir = MakeAbsolute(new DirectoryPath($"{artifactsDir}{entry.Value}/{config}/{tfm}/{rid}"));
IEnumerable<string> applications;
if (isAndroid)
{
applications = FindApksInDirectory(binDir);
}View on GitHub (pinned to f377ff1c5e)
Solutions
- Build the target app with the exact configuration, TFM, and runtime identifier the test step expects.
- Verify artifactsDir is set and that projectMappings includes the project under test.
- Inspect the actual artifact layout (bin vs artifacts) and align the search inputs, or pass an explicit app path.
- If using a solution filter, ensure the app project is included in the filter that ran.
Defensive patterns
Strategy: validation
Validate before calling
var applications = FindAppsInDirectory(binDir);
if (!applications.Any())
applications = SearchInArtifacts(binDir, project, config, tfm, rid, isAndroid, artifactsDir);
if (!applications.Any())
throw new Exception($"No app found. Searched bin='{binDir}' and artifacts for project='{project}', config='{config}', tfm='{tfm}', rid='{rid}'. Build the app first."); Prevention
- Always run the app build step before the test step with matching config/tfm/rid.
- Ensure projectMappings covers every project under test.
- Log every directory searched so missing-app failures are self-diagnosing.
When it happens
Trigger: applications remains empty after checking binDir, FindAppsInDirectory(binDir), and SearchInArtifacts(binDir, project, config, tfm, rid, isAndroid, artifactsDir). No .apk/.app/.appx matches the supplied parameters.
Common situations: The app was never built; built under a different configuration/TFM/RID than the test step queries; the artifactsDir/projectMappings don't cover the project; a publish-vs-build mismatch (looking in bin/ but app is in publish/ or artifacts/).
Related errors
- UI Test application path not specified.
- UI Test application path not specified.
- Unexpected platform (expected: android) in device: {deviceDe
- Unexpected device type (expected: device|emulator) in device
- LoadView must be called before accessing View
AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13).
Data as JSON: /api/errors/964c4deafac0a5a0.
Report an issue: GitHub.