Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Assets][Project File Management][Resizetizer] Image Management in nested folder structure resulting in Exceptions #19497

Open
DevTKSS opened this issue Feb 10, 2025 · 0 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@DevTKSS
Copy link
Contributor

DevTKSS commented Feb 10, 2025

Current behavior

Issue first mentioned in #19486 seperated for brewity:

and an error occurs when trying to change the file's “Generate Action” property
(This issue is only reproduced successfully for image files.)

Successfully reproducable and possible issue source is the Uno.Resizetizer in my opinion but absolutly possible, its a combination with the Visual Studio csproj project management:

20250210-2030-03.1036322.mp4

Noticeable:

  1. This behaviour is reproduceable by both templates(blank and recommended), not depending on the arguments you add, also via the vs 2022 ui wizard!
  2. The App in the attached Video is created by
    dotnet new unoapp -preset blank -toolkit false
    to get the lowest configuration possible, but reading documentation, its not possible, even in a blank preset, to exclude the Resizitizer to exclude it from any other possible issue source.
  3. This behaviour is only happening if the user do not follow the getting started and declaring his images as UnoImage or any other Resizetizer format
  4. Once this Image has been set to any supported Resizetizer Tag following the tutorial, its remembering this no matter where it is future moved in the solution map.
  5. @Starcloudsea has had posted this Image (I added the parts I noticed beeing different as expected):

Image

In the documentation is not mentioned, that its not allowed to have nested folders, but somehow it seems Visual Studio 2022 .csproj file management might have issues with this, but to be sure, I would like to have one of the Uno Team check the Resizetizer actions and known automated uno.sdk actions on the .csproj file generation maybe sourcing in the uno things before giving the issue-ball back to the visual studio dev team

Edit:
my example in the video is a Resizetizer compartible png. In case you doing the repro steps listed below, you can estimate the initial issue message in this form:

Image

Expected behavior

  • Images should be added to the ItemGroup's in the csproj file, also in case of beeing nested in folders
  • if (not UnoImages) Images are moved across any Assets folder structure, they should not suddenly disappear from the csproj file, which is most likly resulting in the above added issue screenshot, also happening in my repro made video.

How to reproduce it (as minimally and precisely as possible)

  1. dotnet new unoapp -preset blank
  2. add a Image to the assets folder
  3. No ItemGroup will be added in the csproj file
  4. add some folder into the assets folder
  5. folder will be added as normal
  6. move image from 2 into this folder or add some other image to this nested folder
  7. the folder from 5 where you inserted it will vanish from the csproj file and also no image will be included there
  8. as reasonable, if you now try to change the Build Action for this, from csproj unknown and vanished image you will be prompted with the message, that it has failed because image was object == unknown
  9. Instead add the <UnoImage Include=Assets\Images\someimagename.png manually inside of an ItemGroup to the csproj, everything will be fine
  10. Alternative to 9, you can add <UnoImage Include=Assets\Images\* as research able in the getting started documenation and Uno.Resitzetizer, any Image you now add in this folder will be added just fine as UnoImage
  11. Move the image from 9 (has been UnoImage) in a new created nested folder to Assets\Images\, your UnoImage will now be Prefixed with Remove instead of Include (Folder from 10 still untouched) and you can start this diagramm back at step 5
  12. Move the now again unknown image back into the UnoImage * folder from 10 and Congratulations! your Image is back in the app!

Workaround

Do not try to not-use Uno.Resizetizer
for those who not know how to start Uno Apps with using assets, the Uno Counter App is a good starting point, including the link to the Uno.Resizetizer after providing a sample svg which is also a Resizetizer compartible format
Any non Uno Image has to be added to the csproj file by manual approach with adding it in a ItemGroup

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

Automatically added from above listed cmd:

Image

Affected platforms

Build tasks

IDE

Visual Studio 2022

IDE version

17.12.4

Relevant plugins

none

Anything else we need to know?

Application is Building, but this issue is not letting the developer add images as he wants and binds him to the Uno.Resizetizer which should not be the case or target

@DevTKSS DevTKSS added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

1 participant