github CommunityToolkit/Maui 2.0.1-maps
v2.0.1 Windows Maps: bugfix for crash!

latest releases: 9.1.1, 2.0.4-maps, 4.1.2-mediaelement...
7 months ago

This release fixes a crash that was introduced when updating .NET MAUI to version 8.0.10.

As part of this change in .NET MAUI, the initialisation call for the .NET MAUI Community Toolkit Maps would also crash because the Toolkit was call the .NET MAUI UseMauiMaps call as part of the initialisation.

This call was not needed, but until now did not cause any problems. We removed the call and thus fixed the crash.

More information can be found here: dotnet/maui#21360

To correctly initialise the .NET MAUI Maps as well as the Toolkit Maps you MauiProgram should look something like this:

  var builder = MauiApp.CreateBuilder();
  builder
	  .UseMauiApp<App>()
	  .ConfigureFonts(fonts =>
	  {
		  fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
		  fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
	  });

    #if IOS || ANDROID
    builder.UseMauiMaps();
    #endif
    
    #if WINDOWS
    // Initialize the .NET MAUI Community Toolkit Maps by adding the below line of code
    builder.UseMauiCommunityToolkitMaps("key")
    #endif

   return builder.Build();

Don't miss a new Maui release

NewReleases is sending notifications on new releases.