0

I'm working on a Maui Blazor project on Windows, and I wanted to add my logo (Png format) for this project.

So in package.appxmanifest > Visual Assets, I added my logo (name: store_logo.png).

enter image description here

Visual Studio recreates my logo in different size and aspect (ex:targetsize-24,unplated), and assigns a new file name.

But when i wanted to build my project, an error occured:

One or more invalid file names were detected. File names must be lowercase, start and end with a letter character, and contain only alphanumeric characters or underscores: $placeholder$.altform-unplated_targetsize-16, $placeholder$.altform-unplated_targetsize-24, $placeholder$.altform-unplated_targetsize-256, $placeholder$.altform-unplated_targetsize-32, $placeholder$.altform-unplated_targetsize-48, $placeholder$.scale-100, $placeholder$.scale-125, $placeholder$.scale-150, $placeholder$.scale-200, $placeholder$.scale-400, $placeholder$.targetsize-16, $placeholder$.targetsize-24, $placeholder$.targetsize-256, $placeholder$.targetsize-32, $placeholder$.targetsize-48 ChronosTasker C:\Program Files\dotnet\packs\Microsoft.Maui.Resizetizer.Sdk\6.0.419\targets\Microsoft.Maui.Resizetizer.targets

I think the "-" character is causing this error.

But how can I use different target sizes and unplated icons, in my project, if file names cause this issue?

Thank you.

Regards, Samih

Samih EL SAKHAWI
  • 429
  • 4
  • 17
  • Are you saying Visual Studio automatically appended `-NN`? What tool or build option did that? Resizetizer? Perhaps there is an option to change that to `_NN`, which is what is needed given the filename restrictions. – ToolmakerSteve Oct 21 '22 at 20:30
  • @ToolmakerSteve I edited my question with a screenshot of the asset generator that fires my build error. And I didn't found an option to change -NN to _NN – Samih EL SAKHAWI Oct 26 '22 at 20:12
  • Looks like .Net Maui is not compatible with Microsoft Store's Asset Generator. If there is not already an issue about this in [github maui issues](https://github.com/dotnet/maui/issues), you could add an issue. – ToolmakerSteve Oct 26 '22 at 21:35

1 Answers1

0

There are two ways to resolve this problem, you can try as follows:

  1. First please backup your Images folder (Or whatever folder you think the problem resource was in). Then delete the Images folder. Try and compile. Recreate the Images folder and copy files back a few at a time.

  2. This may caused by a .DS_Store file in your Resources/Fonts folder, so please deleted that file. Then click main menu "Build-clean all" and "Rebuild".