dotnet/maui · error · ArgumentException

No IAppIndexingProvider was provided

Error message

No IAppIndexingProvider was provided

What it means

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.

Source

Thrown at src/Controls/src/Core/Application/Application.cs:81

		}

		/// <summary>
		/// Terminates the application.
		/// </summary>
		public void Quit()
		{
			Handler?.Invoke(ApplicationHandler.TerminateCommandKey);
		}

		/// <summary>
		/// Gets the <see cref="IAppLinks"/> for deep linking and app indexing.
		/// </summary>
		public IAppLinks AppLinks
		{
			get
			{
				if (_appIndexProvider == null)
					throw new ArgumentException("No IAppIndexingProvider was provided");
				if (_appIndexProvider.AppLinks == null)
					throw new ArgumentException("No AppLinks implementation was found, if in Android make sure you installed the Microsoft.Maui.Controls.AppLinks");
				return _appIndexProvider.AppLinks;
			}
		}

		/// <summary>
		/// Sets the current application instance.
		/// </summary>
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void SetCurrentApplication(Application value) => Current = value;

		/// <summary>
		/// Gets or sets the current application instance.
		/// </summary>
		public static Application? Current { get; set; }

		Page? _singleWindowMainPage;

View on GitHub (pinned to f377ff1c5e)

Solutions

  1. Register an IAppIndexingProvider with the application before accessing AppLinks (set it via your platform/Application setup).
  2. If targeting Android, install the Microsoft.Maui.Controls.AppLinks package which supplies the provider and AppLinks implementation.
  3. Guard the AppLinks access behind a check that the provider is configured before reading the property.

Example fix

// before
var links = Application.Current.AppLinks; // throws if no provider
// after
if (Application.Current?.AppLinks is IAppLinks links) { /* use links */ }
Defensive patterns

Strategy: try-catch

Validate before calling

// Check the provider is available before reading AppLinks.
static IAppLinks? TryGetAppLinks(Application app)
{
    try { return app.AppLinks; }
    catch (ArgumentException) { return null; }
}

Type guard

// If you hold the provider reference, guard on it directly.
static bool HasAppLinks(Application app) => GetAppIndexProvider(app) is not null;

Try / catch

try { var links = Application.Current.AppLinks; }
catch (ArgumentException ex) when (ex.Message.Contains("IAppIndexingProvider"))
{ /* deep linking not configured; disable related UI */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13). Data as JSON: /api/errors/3a0e698dc3cba799. Report an issue: GitHub.