Replies: 18 comments 30 replies
-
Can you check the name of images in the resources folder. The images should follow the naming as described in the error message. Do necessary changes in the name of the images and try to compile the project again. |
Beta Was this translation helpful? Give feedback.
-
Sometimes deleting obj and bin will resolve this issue... |
Beta Was this translation helpful? Give feedback.
-
Has the same issue. I inserted two png images with correct names. Now I have this error.
Nothing help. |
Beta Was this translation helpful? Give feedback.
-
Same as @Vunda. Done the same steps. I know the files I copied into the images folder had invalid characters, but I fixed them in finder before using them in the project. Even tried to reinstall visual studio for mac with no success. Still seems to have the invalid name in some "cache" outside of bin and obj. |
Beta Was this translation helpful? Give feedback.
-
just hit this myself, caused by a .DS_Store file in my Resources/Fonts folder, deleted that file and it went away. |
Beta Was this translation helpful? Give feedback.
-
Seriously? For this phantom we can indeed search a long time… Have my like and my gratitude, sir... |
Beta Was this translation helpful? Give feedback.
-
Had this issue. Backup your Images folder (Or whatever folder you think the problem resource was in). BTW, I didn't see any hidden files in that Images folder (but doesn't mean they weren't there) |
Beta Was this translation helpful? Give feedback.
-
These are the main problems in .Net Maui Tooling... Sometimes I cannot determine the exact code error, because when there is only one error in code... The error will multiply to hundreds times, and we cannot determine the single error... There is one time that, just deleting Bin and Obj will not compile again and fail to rebuild. So I need to create another project with the same project name, so that Bin and Obj working again... BUGS IS IN .NET MAUI TOOLING. |
Beta Was this translation helpful? Give feedback.
-
I have the same issue I can't run it form Rider for Mac, but I can build the app in AzureDevOps. |
Beta Was this translation helpful? Give feedback.
-
Same issues with many guys. I copyied an .png file to Images folder, complile and errors occured. I deleted the Images folder and copy back the default dotnet_bot.svg file, clean all and rebuild solution, still have 3 errors. Something else still in cache... |
Beta Was this translation helpful? Give feedback.
-
I had this issue too, the error message did not include any image names. I think any files staring with a . will not show as the error message never shows file extensions and just adds an empty string to the message. When I added image files that actually have a naming issues the empty string can be observed at the start of the list of images due to the first comma. End of the error message: I changed the MauiImage rule in the csproj to only include any files ending in .svg like this:
This worked for me. |
Beta Was this translation helpful? Give feedback.
-
THE FINAL SOLUTION. /usr/local/share/dotnet/packs/Microsoft.Maui.Resizetizer.Sdk/6.0.486/targets/Microsoft.Maui.Resizetizer.targets(9,9): Error: 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: App, App.xaml, AppShell, AppShell.xaml, D3MAUI, Hero, MainPage, MainPage.xaml, MauiProgram, D3MAUI.csproj.nuget.dgspec, D3MAUI.csproj.nuget.g, D3MAUI.csproj.nuget.g, .NETCoreApp,Version=v6.0.AssemblyAttributes, D3MAUI.AssemblyInfo, D3MAUI.AssemblyInfoInputs, D3MAUI.assets, D3MAUI.csproj.AssemblyReference, D3MAUI.GeneratedMSBuildEditorConfig, D3MAUI.GlobalUsings.g, project.assets, project.nuget, AppDelegate, Info, Program, launchSettings (D3MAUI) Try below steps(D3MAUI is my project name, you should replace it with your own prj name. And I changed csproj file to keep net6.0-maccatalyst only, which means I dropped iOS/Android/Windows building packages) Step 1. Just open mauiimage.inputs file from folder "/Users/{your name}/Projects/D3MAUI/D3MAUI/obj/Debug/net6.0-maccatalyst", you'll found something like "File=bin/Debug/net6.0-maccatalyst/maccatalyst-x64/stderr.log;Link=;BaseSize=;Resize=;TintColor=;Color=;IsAppIcon=;ForegroundScale=;ForegroundFile= Step2. So, for example, right click "stderr.log" from Solution explorer, click "build action" menu item , and click "None" instead of "MauiImage". Click main menu "Build-Clear All", and "rebuild all". Step 3. Repeat step1 and step2, until file "mauiimage.inputs" keep only your corresponding image files instead of other non image files. Step 4. You'll find the last compile error: Error: 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: , file name "," means a hidden file ds_store Step 5. open your terminal and switch to corresponding csproj folder, type below command Step 6. Click main menu "Build-clean all" and "Rebuild" It's OK now. |
Beta Was this translation helpful? Give feedback.
-
For me the issue was due to the .DS_Store files macOS creates on certain folders. I executed this line on my terminal and then I re-build the app and worked very good.
Note: You need to navigate to the path where your project is located in the terminal and then execute the line above. |
Beta Was this translation helpful? Give feedback.
-
Any additional ideas or thoughts or updates on this? The ideas above did not resolve these errors for us. |
Beta Was this translation helpful? Give feedback.
-
Had I actually read the error message I would have figured it out quickly... "start with a lowercase..." The image file I brough in started with an uppercase. Obviously when I changed this to lowercase it went away. |
Beta Was this translation helpful? Give feedback.
-
Here is the answer : It worked for me |
Beta Was this translation helpful? Give feedback.
-
Hi |
Beta Was this translation helpful? Give feedback.
-
My solution to all of these,, is rewriting the app from maui to flutter... |
Beta Was this translation helpful? Give feedback.
-
AS the name suggest, this happens only on Mac.
Error details as follows:
/usr/local/share/dotnet/packs/Microsoft.Maui.Resizetizer.Sdk/6.0.200-preview.14.5099/targets/Microsoft.Maui.Resizetizer.targets(9,9): Error:
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:
This is how the error appears. There is no indication on what is causing this issue. Font is not an issue here.
Here is how the project file looks like:
The stupid thing is, it works fine on Windows.
Beta Was this translation helpful? Give feedback.
All reactions