Type x:String not found

Jassim Al Rahma 1,526 Reputation points
2022-08-10T22:27:20.087+00:00

Hi,

Why I am getting below error in MAUI?

Here is my code:

<?xml version = "1.0" encoding = "UTF-8" ?>  
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"  
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"  
    xmlns:local="clr-namespace:Ansab"  
    x:Class="Ansab.App">  
    <Application.Resources>  
        <ResourceDictionary>  
            <x:String x:Key="CloseIconColorLight">#ff0000</x:String>  
            <x:String x:Key="CloseIconColorDark">#FFFF00</x:String>  
  
            <x:String x:Key="ActionHeaderIconColorLight">#000080</x:String>  
            <x:String x:Key="ActionHeaderIconColorDark">#0000FF</x:String>  
  
            <x:String x:Key="IconShare">&#xf1e1;</x:String>  
            <x:String x:Key="IconClose">&#xf107;</x:String>  
  
            <ResourceDictionary.MergedDictionaries>  
                <ResourceDictionary Source="Resources/Styles/Colors.xaml" />  
                <ResourceDictionary Source="Resources/Styles/Styles.xaml" />  
            </ResourceDictionary.MergedDictionaries>  
        </ResourceDictionary>  
    </Application.Resources>  
</Application>  

and this is the error:

Microsoft.Maui.Controls.Xaml.XamlParseException: Position 8:14. Type x:String not found in xmlns http://schemas.microsoft.com/winfx/2009/xaml

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,969 questions
{count} votes