Hi TomHintz,
In Solution Explorer set the image file's Build Action property to Resource. Then clean the solution and rebuild it.
Best regards,
Zhanglong
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I created my fist WPF app under .Net Core 3.1 in the latest VS 2019. Its just the stock Window when the project is first created and I want to set the Windows icon so I visited the project properties and clicked the link to add Resources. This creates Resources.resx under a Properties folder. I imported an existing favicon.ico into the resources and then tried setting the main Window's Icon="Resources/favicon.ico" resulting in an error for that property.
I've read that a "build action" is needed but I see no button or property for that.
How is the problem resolved? Thanks,
Hi TomHintz,
In Solution Explorer set the image file's Build Action property to Resource. Then clean the solution and rebuild it.
Best regards,
Zhanglong
Thank you for the answer. Actually, I had imported an existing item into the resource, but that does not copy the resource into the resource folder. I manually copied the resource and then your solution works.