Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/306.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WPF-如何将构建操作设置为';资源“;使用VS代码?_C#_Wpf_.net Core_Visual Studio Code - Fatal编程技术网

C# WPF-如何将构建操作设置为';资源“;使用VS代码?

C# WPF-如何将构建操作设置为';资源“;使用VS代码?,c#,wpf,.net-core,visual-studio-code,C#,Wpf,.net Core,Visual Studio Code,我希望使用VS代码和.NETCore3.1.102创建一个WPF应用程序 我对图像有问题,我看不见 <Grid> <Image Source="system-tray.jpg"/> </Grid> 对于Visual Studio,此问题已由解决 他的解决方案是“确保VisualStudio中图像文件的生成操作设置为“资源”。 但是如何使用VS代码将构建操作设置为“资源”?在csproj文件中,添加 <ItemGroup> <

我希望使用VS代码和.NETCore3.1.102创建一个WPF应用程序 我对图像有问题,我看不见

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

对于Visual Studio,此问题已由解决 他的解决方案是“确保VisualStudio中图像文件的生成操作设置为“资源”。 但是如何使用VS代码将构建操作设置为“资源”?

在csproj文件中,添加

<ItemGroup>
   <Resource Include="system-tray.jpg" />
</ItemGroup>


您已链接到该用户。更改链接以转到找到所引用解决方案的问题。:-)用户的解决方案是针对Visual Studio的,VS代码不是那么完整,也没有属性窗口,但我刚刚读到它似乎是一个很好的解决方案…干得好!把它放进去,回答你自己的问题。VS代码正变得越来越流行,而且这种情况会越来越常见。