Open mcNets opened 2 months ago
@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)
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.
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?
@agneszitte probably, but I do not believe anything changed regarding this issue.
@agneszitte probably, but I do not believe anything changed regarding this issue.
@jeromelaban, @dansiegel (cc @MartinZikmund as you opened https://github.com/unoplatform/uno.resizetizer/issues/264) Still happening lately even with the latest VS version, we should report the issue if it is related to VS
This may somehow be related to https://github.com/unoplatform/uno/issues/16605
The error is reported as https://developercommunity.visualstudio.com/t/Changing-the-build-action-of-a-globbed-i/10658712.
In the meantime, if you want to include an SVG as an actual SVG file, make sure to place it in a folder named Svg
.
The error was reported to be caused by:
which forces the Content to be removed. We'll have to figure out a way to avoid doing so.
Current behavior
Changing Build property from
UnoImage
toContent
of a .svg image added to a new solution (Windows & Skia) throws and error: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:
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:
In the properties tool window try to change from UnoImage
Try to change Build property from
UnoImage
toContent
in the properties tool window.Visual studio throws this error message:
Workaround
You can manually change:
to
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