We've seen this error a lot with the Xamarin Community Toolkit. Now with .NET MAUI Maps we want the Map to appear as being "in the box" with .NET MAUI and let people just use <Map /> without having to add an extra XML namespace. However, because the Map is in another assembly, the assembly won't get loaded resulting in this error.
Visual Studio will throw a XFC0000 error with XamlC and potentially during runtime another error since it won't load the external assembly.
Ideally we fix this for all external assemblies, but at the very least we should do it for Maps.
Add UseMauiMaps() and potentially a Google Maps API key if needed, this error happens on both iOS and Android
Build the app, a XCF0000 should come up
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
All
Did you find any workaround?
Add xmlns:maps="clr-namespace:Microsoft.Maui.Controls.Maps;assembly=Microsoft.Maui.Controls.Maps" to the root of your XAML and use the map as <maps:Map /> makes it work.
Description
We've seen this error a lot with the Xamarin Community Toolkit. Now with .NET MAUI Maps we want the
Map
to appear as being "in the box" with .NET MAUI and let people just use<Map />
without having to add an extra XML namespace. However, because theMap
is in another assembly, the assembly won't get loaded resulting in this error.Visual Studio will throw a XFC0000 error with XamlC and potentially during runtime another error since it won't load the external assembly.
Ideally we fix this for all external assemblies, but at the very least we should do it for Maps.
In earlier investigations (for Forms) I thought the source of this was here: https://github.com/xamarin/Xamarin.Forms/blob/caab66bcf9614aca0c0805d560a34e176d196e17/Xamarin.Forms.Xaml/XamlParser.cs#L340
Steps to Reproduce
<Map />
to your XAMLUseMauiMaps()
and potentially a Google Maps API key if needed, this error happens on both iOS and AndroidVersion with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
All
Did you find any workaround?
Add
xmlns:maps="clr-namespace:Microsoft.Maui.Controls.Maps;assembly=Microsoft.Maui.Controls.Maps"
to the root of your XAML and use the map as<maps:Map />
makes it work.Relevant log output
No response