Why is Maui's "Colors.xml" not found building with Visual Studio Mac but is with Visual Studio Windows?

Marc George 171 Reputation points
2023-03-21T18:20:33.5833333+00:00

Using VS Mac 17.6 Preview 2, building a MAUI application, it is responding with "Resource "Resources/Styes/Colors.xml" not found (XFC0124)" as an error. Building the exact same code, just copied to the Mac for its build, with VS Windows 17.6.0 Preview 1.0, the build is successful and deploys to an iPhone. Why?

The code with the error is the App.xml file.

<?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:Sentry"
             x:Class="Sentry.App">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/Styles/Colors.xaml" />
                <ResourceDictionary Source="Resources/Styles/Styles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,261 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,712 questions
{count} votes

2 answers

Sort by: Most helpful
  1. no-more-moire 10 Reputation points
    2023-06-18T00:48:40.56+00:00
    In my case,
    
    1)Open my .csproj file.
    2)Find these lines.
    	<ItemGroup>
    	  <MauiXaml Remove="Resources\Styles\Styles.xaml" />
    	  <MauiXaml Remove="Resources\Styles\Colors.xaml" />
    	</ItemGroup>
    3)Delete them.
    
    But,I don't know when or how these lines added.
    
    2 people found this answer helpful.
    0 comments No comments

  2. randayossry-8690 0 Reputation points
    2023-06-18T01:02:22.8633333+00:00

    How do I get followers?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.