How can I have an entire folder be an embedded resource in a Visual Studio project?

前端 未结 1 1657
天命终不由人
天命终不由人 2021-02-19 01:23

I\'m working on a project which we\'ll call Container. Container has a bunch of EmbeddedResources. The original files for these EmbeddedResources are another project which we\

相关标签:
1条回答
  • 2021-02-19 01:52

    Edit the project file for Container in a text editor and find the <EmbeddedResource> elements that link to the files in FileProject:

    <EmbeddedResource Include="..\FileProject\Copy.bmp">
      <Link>Copy.bmp</Link>
    </EmbeddedResource>
    <EmbeddedResource Include="..\FileProject\Paste.bmp">
      <Link>Paste.bmp</Link>
    </EmbeddedResource>
    

    Delete all of these elements and replace them with a single <EmbeddedResource> element that has a suitable wildcard:

    <EmbeddedResource Include="..\FileProject\*.bmp" />
    

    Now if you add Cut.bmp to FileProject, it will also show up in Container.

    0 讨论(0)
提交回复
热议问题