VS and Maui don't seem to know about each other or caching is wrong

Lloyd Sheen 1,386 Reputation points
2022-10-03T15:08:12.613+00:00

So I have list of images (png) that correspond to items by name. I have method to remove all none good characters from the name and toLower. The problem is that before I copied all the images to a folder I added one image just to make sure what I was doing was correct. It worked so I had code that worked (yeah sure).

That image has a Build Action of MauiAsset and when I simply use it in a simple Image control it works. I then tried another image with the same Build Action and it failed. I changed it to MauiImage and it worked. Changing the Build Action to MauiAsset and it still worked so I think that VS and Maui which somehow do a partial build depending on what it thinks should be done is wrong.

Now I have about 50 image and I could change each one but WHY????

I am using the ImageSource.FromFile to get the ImageSource but am I required to create them as MauiAsset and the change to MauiImage??

Totally confused as to what is supposed to be the correct way since one works after much screwing around and the other kinda works.

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