Skip to content

[SVG] Changing UnoImage to Content throws and error in Visual Studio #15863

Open

Description

@mcNets

Current behavior

Changing Build property from UnoImage to Content of a .svg image added to a new solution (Windows & Skia) throws and error:

Property value is not valid.
An error has occurred while saving the edited properties listed below:
Build Action
One or more values are invalid. value is object

Expected behavior

Build property should change from UnoImage to Content.

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

  • Generate a new solution for Windows and Skia. I used this command:
dotnet new unoapp -o unosvgcli -id "com.companyname.unosvgcli" -pub "O=unosvgcli" -platforms "windows" -platforms "gtk" -pwa False -theme "fluent" -presentation "none" -config false -di false -log "none" -nav "blank" -http false -loc false -server false -tests "none" -toolkit false -dsp false
  • Add an Images folder to the Assets folder in the main project.

  • Add a .svg file to the Assets/Images folder using 'Add existing item'. This lines are added to the main project:

  <ItemGroup>
    <Content Remove="Assets\Images\uno.svg" />
  </ItemGroup>
  <ItemGroup>
    <None Remove="Assets\Images\uno.svg" />
  </ItemGroup>
  • In the properties tool window try to change from UnoImage

  • Try to change Build property from UnoImage to Content in the properties tool window.

Visual studio throws this error message:

Property value is not valid.
An error has occurred while saving the edited properties listed below:
Build Action
One or more values are invalid. value is object

Workaround

You can manually change:

  <ItemGroup>
    <Content Remove="Assets\Images\uno.svg" />
  </ItemGroup>
  <ItemGroup>
    <None Remove="Assets\Images\uno.svg" />
  </ItemGroup>

to

  <ItemGroup>
    <Content Include="Assets\Images\uno.svg" />
  </ItemGroup>
  <ItemGroup>
    <None Remove="Assets\Images\uno.svg" />
  </ItemGroup>

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

Uno templates: 5.1.25

Visual Studio 17.10 Prev. 1

Activity

  1. added
    difficulty/tbd
    kind/bug
    triage/untriaged
    on Mar 12, 2024
  2. changed the title [-]Changing UnoImage to Content throw and error in Visual Studio[/-] [+]Changing UnoImage to Content throws and error in Visual Studio[/+] on Mar 12, 2024
  3. changed the title [-]Changing UnoImage to Content throws and error in Visual Studio[/-] [+][SVG] Changing UnoImage to Content throws and error in Visual Studio[/+] on Mar 12, 2024
  4. agneszitte commented on Mar 12, 2024

    @agneszitte
    Member

    @mcNets Thank you for opening the issue with the details. Really appreciated!

    For anyone looking at this issue, there are two main things here:
    (Both of these related issues were reproduced with VS Stable 17.9.2 and VS Preview 17.10 Prev. 1 and while using cli or wizard)

      • When we add an svg file in the Assets folder, by default the "Build action" visible in the "Properties" is "UnoImage" and when we try to change "UnoImage" to "Content" while using the dropdown in VS, we are getting an error 'Property value is not valid'.
        image

      • Even though the "Build action" in "Properties" shows "UnoImage" as a value that we are not able to update with the dropdown, on the other hand in the ProjectName.csproj, the <Content /> is properly added by default but we need to manually update "Remove" for "Include" in the csproj to be able to properly include the svg.

        So we need to manually change this:
        <Content Remove="Assets\Images\uno.svg" />

        For this:
        <Content Include="Assets\Images\uno.svg" />

    (cc @jeromelaban, @MartinZikmund, @nickrandolph)

  5. added
    area/svg
    on Mar 13, 2024
  6. jeromelaban commented on Mar 13, 2024

    @jeromelaban
    Member

    Thanks for the details. This looks like a visual studio issue we'll have to report, and as far as I know, UnoImage is listed as a supported item type, @dansiegel may confirm.

  7. agneszitte commented on Apr 12, 2024

    @agneszitte
    Member

    Thanks for the details. This looks like a visual studio issue we'll have to report, and as far as I know, UnoImage is listed as a supported item type, @dansiegel may confirm.

    @jeromelaban, @dansiegel should I give it another try with latest VS stable and latest VS Preview?

  8. jeromelaban commented on Apr 13, 2024

    @jeromelaban
    Member

    @agneszitte probably, but I do not believe anything changed regarding this issue.

  9. added
    difficulty/medium 🤔
    and removed
    triage/untriaged
    difficulty/tbd
    on Apr 18, 2024
  10. agneszitte commented on May 9, 2024

    @agneszitte
    Member

    @agneszitte probably, but I do not believe anything changed regarding this issue.

    @jeromelaban, @dansiegel
    (cc @MartinZikmund as you opened unoplatform/uno.resizetizer#264)
    Still happening lately even with the latest VS version, we should report the issue if it is related to VS

  11. jeromelaban commented on May 9, 2024

    @jeromelaban
    Member

    This may somehow be related to #16605

  12. 8 remaining items

  13. removed their assignment
    on Nov 21, 2024
  14. added theissue type on Jun 20, 2025
  15. github-actions commented on May 2, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  16. added
    stale
    on May 2, 2026
  17. removed
    stale
    on May 4, 2026
  18. github-actions commented on Oct 17, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  19. added
    stale
    on Oct 17, 2026
  20. github-actions commented on Oct 27, 2026

    @github-actions
    Contributor

    This issue was closed because it had no activity for 10 days after being marked as stale. If you believe this is still relevant, feel free to reopen it or open a new issue with updated context.

  21. Jen-Uno commented on Oct 28, 2026

    @Jen-Uno
    Contributor

    This issue was closed as not planned, so there is nothing for QA to verify. Moving it from Ready for QA Review to Done on the Uno Team Backlog.

  22. removed
    stale
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked/vskind/bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions