{"record":{"id":"3a0e698dc3cba799","repo":"dotnet/maui","slug":"no-iappindexingprovider-was-provided","errorCode":null,"errorMessage":"No IAppIndexingProvider was provided","messagePattern":"No IAppIndexingProvider was provided","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Controls/src/Core/Application/Application.cs","lineNumber":81,"sourceCode":"\t\t}\n\n\t\t/// <summary>\n\t\t/// Terminates the application.\n\t\t/// </summary>\n\t\tpublic void Quit()\n\t\t{\n\t\t\tHandler?.Invoke(ApplicationHandler.TerminateCommandKey);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Gets the <see cref=\"IAppLinks\"/> for deep linking and app indexing.\n\t\t/// </summary>\n\t\tpublic IAppLinks AppLinks\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_appIndexProvider == null)\n\t\t\t\t\tthrow new ArgumentException(\"No IAppIndexingProvider was provided\");\n\t\t\t\tif (_appIndexProvider.AppLinks == null)\n\t\t\t\t\tthrow new ArgumentException(\"No AppLinks implementation was found, if in Android make sure you installed the Microsoft.Maui.Controls.AppLinks\");\n\t\t\t\treturn _appIndexProvider.AppLinks;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Sets the current application instance.\n\t\t/// </summary>\n\t\t[EditorBrowsable(EditorBrowsableState.Never)]\n\t\tpublic static void SetCurrentApplication(Application value) => Current = value;\n\n\t\t/// <summary>\n\t\t/// Gets or sets the current application instance.\n\t\t/// </summary>\n\t\tpublic static Application? Current { get; set; }\n\n\t\tPage? _singleWindowMainPage;","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Controls/src/Core/Application/Application.cs#L63-L99","documentation":"Thrown by the Application.AppLinks getter when _appIndexProvider is null, meaning no IAppIndexingProvider was registered with the application. AppLinks (deep linking / app indexing) cannot be returned without a backing provider, so the call fails fast instead of returning a null service.","triggerScenarios":"Accessing Application.Current.AppLinks (or any code path that reads the AppLinks property) before any code has assigned an IAppIndexingProvider to the Application instance, so _appIndexProvider == null triggers the ArgumentException.","commonSituations":"Calling AppLinks during early startup before platform init; using deep-link APIs on a platform that never registered the provider; migrating a Xamarin.Forms app that relied on automatic AppLinks wiring that no longer exists in .NET MAUI.","solutions":["Register an IAppIndexingProvider with the application before accessing AppLinks (set it via your platform/Application setup).","If targeting Android, install the Microsoft.Maui.Controls.AppLinks package which supplies the provider and AppLinks implementation.","Guard the AppLinks access behind a check that the provider is configured before reading the property."],"exampleFix":"// before\nvar links = Application.Current.AppLinks; // throws if no provider\n// after\nif (Application.Current?.AppLinks is IAppLinks links) { /* use links */ }","handlingStrategy":"try-catch","validationCode":"// Check the provider is available before reading AppLinks.\nstatic IAppLinks? TryGetAppLinks(Application app)\n{\n    try { return app.AppLinks; }\n    catch (ArgumentException) { return null; }\n}","typeGuard":"// If you hold the provider reference, guard on it directly.\nstatic bool HasAppLinks(Application app) => GetAppIndexProvider(app) is not null;","tryCatchPattern":"try { var links = Application.Current.AppLinks; }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"IAppIndexingProvider\"))\n{ /* deep linking not configured; disable related UI */ }","preventionTips":["Register IAppIndexingProvider during platform/application setup before any deep-link code runs.","Gate deep-link features behind a capability check so the app degrades gracefully without the provider.","Install the Microsoft.Maui.Controls.AppLinks package where app indexing is needed."],"tags":["application","app-links","configuration","null-provider"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}