4

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 ?

Rodger
  • 845
  • 9
  • 21
Gro Zep
  • 41
  • 3
  • You linked to the user. Change the link to go to the question where you found the solution that you are referencing. :-) – Rodger Mar 04 '20 at 00:44
  • 1
    user's solution is for Visual Studio, VS code is not so complete and don't have properties windows , but I just read https://stackoverflow.com/questions/60118384/how-to-include-resource-files-in-dotnet-build-with-visual-studio-code it seems to be a good solution... – Gro Zep Mar 04 '20 at 00:59
  • 2
    Nice job! Put that in and answer your own question. VS Code is getting more and more popular and this is going to come up more often. – Rodger Mar 04 '20 at 01:01

1 Answers1

3

In csproj file, add

<ItemGroup>
   <Resource Include="system-tray.jpg" />
</ItemGroup>
JReno
  • 337
  • 2
  • 15