jpg or jpeg images added to winui3 projects do not get the content build action by default.
See original GitHub issueDescribe the bug
The jpg format images are not showing when using Image control or when using them as background brushes. This is a critical bug and should be fixed at the earliest. It is a very basic thing which devs would expect to work.
Steps to reproduce the bug
- Create a new WinUI 3 in Desktop app.
- Add below xaml inside Stackpanel in MainWindow.xaml
<Image Source="/Assets/treetops.jpg" Height="100" />
- Add treetops.jpg image (from xaml controls gallery sample app) in assets folder.
- Run the app.
Expected behavior
jpg images should be visible correctly.
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.0 (If you’re seeing your issue in older previews of WinUI 3, please try this release)
Windows app type
- UWP
- Win32
Device form factor
Desktop
Windows version
May 2021 Update (19043)
Additional context
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Build actions for files - Visual Studio (Windows)
All files in a Visual Studio project have a build action. The build action controls what happens to the file when the project...
Read more >WPF .NET Core 3 (SDK styled) project: Images (.png, .jpg ...
When you have a .NET Core 3 WPF project in Visual Studio 2019 and you add a .png or a .jpg file, these...
Read more >Assets and image display
Add the image file to the Assets directory of a shared project. Set the build action to Content . Using the asset is...
Read more >WPF - Image 'is not part of the project or its Build Action is ...
In Windows Explorer copy the Image into your project resource folder. · From within Visual Studio right click on the Resources and select...
Read more >[Solved] How to load image files (added to the project) into ...
The image files won't get "Copy" build action in the project, so the build won't copy them in the output directory; the files...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is no bug You must add pictures to the project, or they won’t be compiled WinUI 3 is in good shape…
I wasted several hours trying to understand why
<SvgImageSource/>
doesn’t work. No matter what I did, my SVG image would not show up. Turned out it was because of this bug. This is a significant deviation from past behavior and should eventually be fixed. Setting BuildAction=Content fixed my issue instantly.