Repository navigation
Description
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
UnoImagetoContentin 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
[-]Changing UnoImage to Content throw and error in Visual Studio[/-][+]Changing UnoImage to Content throws and error in Visual Studio[/+][-]Changing UnoImage to Content throws and error in Visual Studio[/-][+][SVG] Changing UnoImage to Content throws and error in Visual Studio[/+]agneszitte commentedon Mar 12, 2024
@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)
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)
jeromelaban commentedon Mar 13, 2024
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.
agneszitte commentedon Apr 12, 2024
@jeromelaban, @dansiegel should I give it another try with latest VS stable and latest VS Preview?
jeromelaban commentedon Apr 13, 2024
@agneszitte probably, but I do not believe anything changed regarding this issue.
agneszitte commentedon May 9, 2024
@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
jeromelaban commentedon May 9, 2024
This may somehow be related to #16605
8 remaining items
github-actions commentedon May 2, 2026
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.
github-actions commentedon Oct 17, 2026
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.
github-actions commentedon Oct 27, 2026
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.
Jen-Uno commentedon Oct 28, 2026
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.