Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF - how to set the build Action to 'Resource" with VS Code?

I m looking to create a WPF application using VS Code and .net Core 3.1.102 I've an issue with Image , I can't see it..

<Grid>
    <Image Source="system-tray.jpg"/>
</Grid>

This issue have been solved for Visual Studio by https://stackoverflow.com/users/2987285/jaykebird his solution was "Make sure the Build Action for your image files in Visual Studio is set to "Resource". But how to set the build Action to 'Resource" with VS Code ?

like image 207
Gro Zep Avatar asked Oct 24 '25 15:10

Gro Zep


1 Answers

In csproj file, add

<ItemGroup>
   <Resource Include="system-tray.jpg" />
</ItemGroup>
like image 130
JReno Avatar answered Oct 26 '25 04:10

JReno



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!