且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在使用Visual Studio Code的dotnet构建中包括资源文件

更新时间:2023-09-26 21:18:40

如果要将其用作嵌入式资源,只需将您的资源文件手动添加到.csproj文件:

Just add your resource file manually to .csproj file if you want to use it as embedded resource:

<EmbeddedResource Include="Resources\images\icon.ico" />

或者如果您要将文件复制到构建文件夹中

or if you want to copy files to your build folder

<ItemGroup>
   <Content Include="Resources\*.*">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
   </Content>
</ItemGroup>